{

   "source": [
    "d = {\"S\":[1,2,3,4,5,6,7,8,9,10,11,12,13],\n",
    "     \"H\":[1,2,3,4,5,6,7,8,9,10,11,12,13],\n",
    "     \"D\":[1,2,3,4,5,6,7,8,9,10,11,12,13],\n",
    "     \"C\":[1,2,3,4,5,6,7,8,9,10,11,12,13]}\n",
    "n = int(input())\n",
    "for i in range(n):\n",
    "    N, M = map(str,input().split())\n",
    "    d[N][int(M)-1] =\"None\"\n",
    "print(\"Answer\")\n",
    "for j in range(len(d)):\n",
    "    if j==1:\n",
    "        list_d = d[\"S\"]\n",
    "        c = \"S\"\n",
    "    elif j == 2:\n",
    "        list_d = d[\"H\"]\n",
    "        c = \"H\"\n",
    "    elif j == 3:\n",
    "        list_d = d[\"C\"]\n",
    "        c = \"C\"\n",
    "    else:\n",
    "        list_d = d[\"D\"]\n",
    "        c = \"D\"\n",
    "    for i in range(len(list_d)):\n",
    "        if(list_d[i] != \"None\"):\n",
    "            print(c , list_d[i])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print(d[\"S\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "for j in range(len(d)):\n",
    "    if j==1:\n",
    "        list_d = d[\"S\"]\n",
    "    elif j == 2:\n",
    "        list_d = d[\"H\"]\n",
    "    elif j == 3:\n",
    "        list_d = d[\"C\"]\n",
    "    else:\n",
    "        list_d = d[\"D\"]\n",
    "        \n",
    "    for i in range(len(list_d)):\n",
    "        if(list_d[i] != \"None\"):\n",
    "            print(list_d[i])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def delete_none(dic):\n",
    "    for k, v in dic.items():\n",
    "        if v is None:\n",
    "            del(dic[k])\n",
    "    return dic\n",
    "#d2 = delete_none(d)\n",
    "print(len(d))\n",
    "for i in range(len(d)):\n",
    "#print(d[\"S\"].remove(None))\n",
    "print(d)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}

