// File: /workspace/github_cpp_makefile_star2_O1/kdungs[P]codecon/src/laundry.cc
// Function: main
int main() {
  const auto printItem = [](const std::size_t count, const std::string& item) {
    std::cout << count << '|' << item << '\n';
  };

  const auto alpha_compare =
      [](const std::string& lhs, const std::string& rhs) {
        return std::lexicographical_compare(
            std::begin(lhs), std::end(lhs), std::begin(rhs), std::end(rhs),
            [](char l, char r) { return std::tolower(l) < std::tolower(r); });
      };

  auto items =
      std::multiset<std::string, decltype(alpha_compare)>(alpha_compare);
  auto line = std::string{};
  while (getline(std::cin, line)) {
    if (line != "") {
      items.emplace(line);
    }
  }

  for (auto it = std::begin(items); it != std::end(items);
       it = items.upper_bound(*it)) {
    const auto& item = *it;
    auto count = items.count(item);

    if (item.find("sock") != std::string::npos) {  // we have a sock!
      if (count > 1) {
        printItem(count / 2, item);
      }
      if (count % 2 == 1) {  // one lonely sock left over
        printItem(0, item);
      }
    } else {
      printItem(count, item);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
leaq 0x48(%rsp), %rbx
movl $0x0, (%rbx)
xorl %eax, %eax
movq %rax, 0x8(%rbx)
movq %rbx, 0x10(%rbx)
movq %rbx, 0x18(%rbx)
movq %rax, 0x20(%rbx)
leaq 0x80(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb $0x0, (%rcx)
movq 0x2cec(%rip), %r14      # 0x3fe0
leaq 0x70(%rsp), %r15
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x10b0
movsbl %al, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x1170
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x14ed
movq %r15, %rdi
leaq 0xcfb(%rip), %rsi       # 0x2032
callq 0x1050
testl %eax, %eax
je 0x12f9
movl $0x40, %edi
callq 0x10c0
leaq 0x20(%rax), %rdi
movq %rax, %rcx
addq $0x30, %rcx
movq %rax, 0x10(%rsp)
movq %rcx, 0x20(%rax)
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
addq %rsi, %rdx
callq 0x1abc
movq 0x50(%rsp), %rax
movq %rbx, %rdx
testq %rax, %rax
je 0x142f
movq 0x10(%rsp), %rcx
movq 0x20(%rcx), %r15
movq 0x28(%rcx), %rcx
movq %rcx, 0x18(%rsp)
movq %rax, %rdx
movq 0x20(%rax), %r13
movq 0x28(%rax), %rax
movq 0x18(%rsp), %rbp
cmpq %rbp, %rax
cmovlq %rax, %rbp
movq %r13, %rcx
testq %rbp, %rbp
je 0x1404
movq %rax, 0x28(%rsp)
movq %rdx, 0x8(%rsp)
movq %r13, %rax
addq %rbp, %rax
movq %rax, 0x20(%rsp)
xorl %r14d, %r14d
movsbl (%r15,%r14), %edi
movsbl (%r13,%r14), %r12d
callq 0x1100
movl %eax, %ebx
movl %r12d, %edi
callq 0x1100
cmpl %ebx, %eax
jne 0x140f
incq %r14
cmpq %r14, %rbp
jne 0x13ca
leaq 0x48(%rsp), %rbx
movq 0x8(%rsp), %rdx
movq 0x28(%rsp), %rax
movq 0x20(%rsp), %rcx
addq %rax, %r13
cmpq %r13, %rcx
setne %al
jmp 0x141c
setg %al
leaq 0x48(%rsp), %rbx
movq 0x8(%rsp), %rdx
xorb $0x1, %al
movzbl %al, %eax
movq 0x10(%rdx,%rax,8), %rax
testq %rax, %rax
jne 0x1393
cmpq %rdx, %rbx
je 0x14bd
movq 0x10(%rsp), %rsi
movq 0x28(%rsi), %r13
movq 0x20(%rdx), %r14
movq 0x28(%rdx), %rax
cmpq %r13, %rax
cmovlq %rax, %r13
movq %r14, %rcx
testq %r13, %r13
je 0x14b2
movq %rax, 0x18(%rsp)
movq %rdx, 0x8(%rsp)
movq 0x20(%rsi), %rbp
leaq (%r14,%r13), %rax
movq %rax, 0x28(%rsp)
xorl %r15d, %r15d
movsbl (%rbp,%r15), %edi
movsbl (%r14,%r15), %ebx
callq 0x1100
movl %eax, %r12d
movl %ebx, %edi
callq 0x1100
cmpl %r12d, %eax
jne 0x14c6
incq %r15
cmpq %r15, %r13
jne 0x1472
leaq 0x48(%rsp), %rbx
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x18(%rsp), %rax
movq 0x28(%rsp), %rcx
addq %rax, %r14
cmpq %r14, %rcx
setne %al
jmp 0x14d8
movb $0x1, %al
movq 0x10(%rsp), %rsi
jmp 0x14d8
setg %al
leaq 0x48(%rsp), %rbx
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
movzbl %al, %edi
movq %rbx, %rcx
callq 0x1030
incq 0x68(%rsp)
jmp 0x12ed
movq 0x58(%rsp), %rax
movq %rax, 0x38(%rsp)
cmpq %rbx, %rax
je 0x19bb
movq 0x50(%rsp), %rcx
movq %rbx, %rax
movq %rbx, %r14
testq %rcx, %rcx
je 0x1795
movq 0x38(%rsp), %rax
movq 0x20(%rax), %r12
movq 0x28(%rax), %rax
movq %rax, 0x28(%rsp)
addq %r12, %rax
movq %rax, 0x10(%rsp)
leaq 0x48(%rsp), %r14
movq %r14, 0x18(%rsp)
movq 0x20(%rcx), %r14
movq %rcx, 0x8(%rsp)
movq 0x28(%rcx), %r15
movq 0x28(%rsp), %rax
cmpq %r15, %rax
movq %r15, 0x20(%rsp)
cmovlq %rax, %r15
movq %r12, %rax
testq %r15, %r15
je 0x1593
leaq (%r12,%r15), %rax
movq %rax, 0x30(%rsp)
xorl %r13d, %r13d
movsbl (%r14,%r13), %edi
movsbl (%r12,%r13), %ebx
callq 0x1100
movl %eax, %ebp
movl %ebx, %edi
callq 0x1100
cmpl %ebp, %eax
jne 0x159d
incq %r13
cmpq %r13, %r15
jne 0x156a
movq 0x30(%rsp), %rax
cmpq 0x10(%rsp), %rax
setne %al
jmp 0x15a0
setg %al
testb %al, %al
je 0x15b4
movq 0x8(%rsp), %rcx
addq $0x18, %rcx
movq 0x18(%rsp), %r14
jmp 0x1611
movq %r14, %rax
testq %r15, %r15
je 0x15f1
leaq (%r14,%r15), %rax
movq %rax, 0x30(%rsp)
xorl %r13d, %r13d
movsbl (%r12,%r13), %edi
movsbl (%r14,%r13), %ebx
callq 0x1100
movl %eax, %ebp
movl %ebx, %edi
callq 0x1100
cmpl %ebp, %eax
jne 0x15fe
incq %r13
cmpq %r13, %r15
jne 0x15c8
movq 0x30(%rsp), %rax
addq 0x20(%rsp), %r14
cmpq %r14, %rax
setne %al
jmp 0x1601
setg %al
testb %al, %al
movq 0x8(%rsp), %rcx
je 0x1625
movq %rcx, %r14
addq $0x10, %rcx
movq (%rcx), %rcx
movq %r14, %rax
testq %rcx, %rcx
jne 0x1533
jmp 0x1795
movq 0x10(%rcx), %rdx
movq 0x18(%rcx), %rax
movq %rax, 0x20(%rsp)
testq %rdx, %rdx
je 0x16d0
movq 0x28(%rdx), %r14
movq 0x28(%rsp), %rax
cmpq %r14, %rax
cmovlq %rax, %r14
movq %r12, %rax
testq %r14, %r14
je 0x16a6
movq %rcx, 0x8(%rsp)
movq %rdx, 0x30(%rsp)
movq 0x20(%rdx), %r15
leaq (%r12,%r14), %rax
movq %rax, 0x90(%rsp)
xorl %r13d, %r13d
movsbl (%r15,%r13), %edi
movsbl (%r12,%r13), %ebx
callq 0x1100
movl %eax, %ebp
movl %ebx, %edi
callq 0x1100
cmpl %ebp, %eax
jne 0x16b0
incq %r13
cmpq %r13, %r14
jne 0x1670
movq 0x8(%rsp), %rcx
movq 0x30(%rsp), %rdx
movq 0x90(%rsp), %rax
cmpq 0x10(%rsp), %rax
setne %al
jmp 0x16bd
setg %al
movq 0x8(%rsp), %rcx
movq 0x30(%rsp), %rdx
testb %al, %al
cmoveq %rdx, %rcx
movzbl %al, %eax
movq 0x10(%rdx,%rax,8), %rdx
jmp 0x1632
cmpq $0x0, 0x20(%rsp)
je 0x178d
movq %rcx, 0x8(%rsp)
movq 0x18(%rsp), %r14
movq 0x20(%rsp), %rcx
movq %r14, 0x18(%rsp)
movq 0x20(%rcx), %r15
movq 0x28(%rcx), %rax
movq 0x28(%rsp), %r14
cmpq %r14, %rax
cmovlq %rax, %r14
movq %r15, %rdx
testq %r14, %r14
je 0x1755
movq %rax, 0x10(%rsp)
movq %rcx, 0x20(%rsp)
leaq (%r15,%r14), %rax
movq %rax, 0x30(%rsp)
xorl %r13d, %r13d
movsbl (%r12,%r13), %edi
movsbl (%r15,%r13), %ebx
callq 0x1100
movl %eax, %ebp
movl %ebx, %edi
callq 0x1100
cmpl %ebp, %eax
jne 0x1760
incq %r13
cmpq %r13, %r14
jne 0x1722
movq 0x20(%rsp), %rcx
movq 0x10(%rsp), %rax
movq 0x30(%rsp), %rdx
addq %rax, %r15
cmpq %r15, %rdx
setne %al
jmp 0x1768
setg %al
movq 0x20(%rsp), %rcx
testb %al, %al
movq 0x18(%rsp), %r14
cmovneq %rcx, %r14
xorb $0x1, %al
movzbl %al, %eax
movq 0x10(%rcx,%rax,8), %rcx
testq %rcx, %rcx
jne 0x16eb
movq 0x8(%rsp), %rax
jmp 0x1795
movq %rcx, %rax
movq 0x18(%rsp), %r14
xorl %r13d, %r13d
leaq 0x48(%rsp), %rbx
cmpq %r14, %rax
je 0x17af
movq %rax, %rdi
callq 0x10f0
incq %r13
jmp 0x179d
movq 0x38(%rsp), %rax
leaq 0x20(%rax), %rdi
movl $0x4, %ecx
leaq 0x840(%rip), %rsi       # 0x2004
xorl %edx, %edx
callq 0x1140
cmpq $-0x1, %rax
je 0x188d
cmpq $0x2, %r13
jb 0x1830
movq %r13, %rsi
shrq %rsi
movq 0x27e8(%rip), %rdi      # 0x3fd0
callq 0x1070
movb $0x7c, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7(%rsp), %rsi
callq 0x10e0
movq 0x38(%rsp), %rcx
movq 0x20(%rcx), %rsi
movq 0x28(%rcx), %rdx
movq %rax, %rdi
callq 0x10e0
movb $0xa, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7(%rsp), %rsi
callq 0x10e0
testb $0x1, %r13b
je 0x18df
movq 0x278f(%rip), %rdi      # 0x3fd0
xorl %esi, %esi
callq 0x1070
movb $0x7c, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7(%rsp), %rsi
callq 0x10e0
movq 0x38(%rsp), %rcx
movq 0x20(%rcx), %rsi
movq 0x28(%rcx), %rdx
movq %rax, %rdi
callq 0x10e0
movb $0xa, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7(%rsp), %rsi
callq 0x10e0
jmp 0x18df
movq 0x273c(%rip), %rdi      # 0x3fd0
movq %r13, %rsi
callq 0x1070
movb $0x7c, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7(%rsp), %rsi
callq 0x10e0
movq 0x38(%rsp), %rcx
movq 0x20(%rcx), %rsi
movq 0x28(%rcx), %rdx
movq %rax, %rdi
callq 0x10e0
movb $0xa, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7(%rsp), %rsi
callq 0x10e0
movq 0x50(%rsp), %rcx
movq %rbx, %rdx
testq %rcx, %rcx
je 0x19a8
movq 0x38(%rsp), %rax
movq 0x20(%rax), %r12
movq 0x28(%rax), %rax
movq %rax, 0x28(%rsp)
leaq 0x48(%rsp), %rdx
movq 0x20(%rcx), %r13
movq 0x28(%rcx), %rax
movq 0x28(%rsp), %r15
cmpq %r15, %rax
cmovlq %rax, %r15
movq %r13, %rsi
testq %r15, %r15
je 0x1977
movq %rax, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq %rcx, 0x8(%rsp)
leaq (%r15,%r13), %rax
movq %rax, 0x10(%rsp)
xorl %r14d, %r14d
movsbl (%r12,%r14), %edi
movsbl (%r13,%r14), %ebx
callq 0x1100
movl %eax, %ebp
movl %ebx, %edi
callq 0x1100
cmpl %ebp, %eax
jne 0x1982
incq %r14
cmpq %r14, %r15
jne 0x193e
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rsi
addq %rax, %r13
cmpq %r13, %rsi
setne %al
jmp 0x198f
setg %al
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rdx
testb %al, %al
cmovneq %rcx, %rdx
xorb $0x1, %al
movzbl %al, %eax
movq 0x10(%rcx,%rax,8), %rcx
testq %rcx, %rcx
jne 0x1907
movq %rdx, 0x38(%rsp)
leaq 0x48(%rsp), %rbx
cmpq %rbx, %rdx
jne 0x1500
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x19dd
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x10d0
movq 0x50(%rsp), %rdi
callq 0x1a62
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x1060
movl $0x40, %esi
movq 0x10(%rsp), %rdi
callq 0x10d0
callq 0x1110
movq %rax, %rbx
callq 0x1130
jmp 0x1a2e
movq %rax, %rdi
callq 0x1ab0
jmp 0x1a2b
movq %rax, %rbx
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x1a50
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x10d0
movq 0x50(%rsp), %rdi
callq 0x1a62
movq %rbx, %rdi
callq 0x1150