// File: /workspace/github_cpp_makefile_star2_O3/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 0x70(%rsp), %r15
movl $0x0, (%r15)
xorl %eax, %eax
movq %rax, 0x8(%r15)
movq %r15, 0x10(%r15)
movq %r15, 0x18(%r15)
movq %rax, 0x20(%r15)
leaq 0x58(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb $0x0, (%rcx)
movq 0x2cee(%rip), %rbx      # 0x3fe0
leaq 0x48(%rsp), %r14
leaq 0xd34(%rip), %r12       # 0x2032
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10b0
movsbl %al, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1170
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x1501
movq %r14, %rdi
movq %r12, %rsi
callq 0x1050
testl %eax, %eax
je 0x12fe
movl $0x40, %edi
callq 0x10c0
movq %rax, %rbp
leaq 0x20(%rax), %rdi
addq $0x30, %rax
movq %rax, 0x20(%rbp)
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
addq %rsi, %rdx
callq 0x1aba
movq 0x78(%rsp), %rax
movb $0x1, %cl
testq %rax, %rax
je 0x149b
movq 0x20(%rbp), %r13
movq %rbp, 0x10(%rsp)
movq 0x28(%rbp), %rcx
movq %rcx, 0x20(%rsp)
movq 0x20(%rax), %r15
movq %rax, 0x8(%rsp)
movq 0x28(%rax), %rax
leaq (%r15,%rax), %rcx
movq 0x20(%rsp), %r14
cmpq %r14, %rax
movq %rax, 0x30(%rsp)
cmovlq %rax, %r14
movq %r15, %rdx
testq %r14, %r14
movq %rcx, 0x18(%rsp)
je 0x13fb
leaq (%r15,%r14), %rax
movq %rax, 0x28(%rsp)
xorl %ebp, %ebp
movsbl (%r13,%rbp), %edi
movsbl (%r15,%rbp), %ebx
callq 0x1100
movl %eax, %r12d
movl %ebx, %edi
callq 0x1100
cmpl %eax, %r12d
jl 0x140c
jg 0x1405
incq %rbp
cmpq %rbp, %r14
jne 0x13c8
movq 0x18(%rsp), %rcx
movq 0x28(%rsp), %rdx
movl $0x10, %eax
cmpq %rcx, %rdx
jne 0x1411
movl $0x18, %eax
jmp 0x1411
movl $0x10, %eax
movq 0x8(%rsp), %rdx
movq (%rdx,%rax), %rax
testq %rax, %rax
jne 0x138e
leaq 0x70(%rsp), %rax
cmpq %rdx, %rax
je 0x14a0
testq %r14, %r14
je 0x1479
addq %r15, %r14
movq 0x20(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpq %rax, %rcx
cmovlq %rcx, %rax
movq %rax, 0x20(%rsp)
xorl %ebp, %ebp
movsbl (%r13,%rbp), %edi
movsbl (%r15,%rbp), %ebx
callq 0x1100
movl %eax, %r12d
movl %ebx, %edi
callq 0x1100
cmpl %r12d, %eax
jne 0x14c1
incq %rbp
cmpq %rbp, 0x20(%rsp)
jne 0x144d
movq %r14, %r15
movq 0x2b60(%rip), %rbx      # 0x3fe0
leaq 0x48(%rsp), %r14
leaq 0xba6(%rip), %r12       # 0x2032
cmpq 0x18(%rsp), %r15
setne %cl
leaq 0x70(%rsp), %r15
jmp 0x14dc
movq %r15, %rdx
jmp 0x14e6
leaq 0x70(%rsp), %r15
movq 0x2b34(%rip), %rbx      # 0x3fe0
leaq 0x48(%rsp), %r14
leaq 0xb7a(%rip), %r12       # 0x2032
movq 0x10(%rsp), %rbp
movb $0x1, %cl
jmp 0x14e6
setg %cl
leaq 0x70(%rsp), %r15
movq 0x2b10(%rip), %rbx      # 0x3fe0
leaq 0x48(%rsp), %r14
leaq 0xb56(%rip), %r12       # 0x2032
movq 0x10(%rsp), %rbp
movq 0x8(%rsp), %rdx
movzbl %cl, %edi
movq %rbp, %rsi
movq %r15, %rcx
callq 0x1030
incq 0x90(%rsp)
jmp 0x12fe
movq 0x80(%rsp), %r12
cmpq %r15, %r12
je 0x19c7
movq 0x78(%rsp), %rax
testq %rax, %rax
je 0x1798
movq 0x20(%r12), %rsi
movq %r12, 0x38(%rsp)
movq 0x28(%r12), %rcx
movq %rcx, 0x20(%rsp)
addq %rsi, %rcx
movq %rcx, 0x30(%rsp)
movq %r15, %rcx
movq %rsi, 0x8(%rsp)
movq %rcx, 0x18(%rsp)
movq 0x20(%rax), %r12
movq %rax, 0x10(%rsp)
movq 0x28(%rax), %r13
movq 0x20(%rsp), %rax
cmpq %r13, %rax
movq %r13, 0x28(%rsp)
cmovlq %rax, %r13
movq %rsi, %r15
testq %r13, %r13
je 0x15a1
leaq (%rsi,%r13), %r15
xorl %r14d, %r14d
movsbl (%r12,%r14), %edi
movsbl (%rsi,%r14), %ebx
callq 0x1100
movl %eax, %ebp
movl %ebx, %edi
callq 0x1100
cmpl %eax, %ebp
jl 0x160e
movq 0x8(%rsp), %rsi
jg 0x15b4
incq %r14
cmpq %r14, %r13
jne 0x1576
movl $0x18, %eax
cmpq 0x30(%rsp), %r15
je 0x15b4
movq 0x18(%rsp), %rcx
jmp 0x1629
movq %r12, %rdx
testq %r13, %r13
je 0x15f8
leaq (%r12,%r13), %rax
movq %rax, 0x40(%rsp)
xorl %r14d, %r14d
movsbl (%rsi,%r14), %edi
movsbl (%r12,%r14), %ebx
callq 0x1100
movl %eax, %ebp
movl %ebx, %edi
callq 0x1100
cmpl %eax, %ebp
jl 0x161a
movq 0x8(%rsp), %rsi
jg 0x164c
incq %r14
cmpq %r14, %r13
jne 0x15c8
movq 0x40(%rsp), %rdx
addq 0x28(%rsp), %r12
movl $0x10, %eax
movq 0x10(%rsp), %rcx
cmpq %r12, %rdx
jne 0x1629
jmp 0x164c
movl $0x18, %eax
movq 0x18(%rsp), %rcx
jmp 0x1624
movl $0x10, %eax
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq (%rdx,%rax), %rax
testq %rax, %rax
jne 0x1544
xorl %ebp, %ebp
movq 0x38(%rsp), %r12
leaq 0x70(%rsp), %r15
jmp 0x17ce
movq 0x10(%rsp), %rax
movq 0x10(%rax), %r13
movq 0x18(%rax), %rax
movq %rax, 0x40(%rsp)
testq %r13, %r13
je 0x16e2
movq 0x28(%r13), %r14
movq 0x20(%rsp), %rax
cmpq %r14, %rax
cmovlq %rax, %r14
movq %rsi, %rax
testq %r14, %r14
je 0x16bb
movq 0x20(%r13), %r12
leaq (%rsi,%r14), %rax
movq %rax, 0x28(%rsp)
xorl %r15d, %r15d
movsbl (%r12,%r15), %edi
movsbl (%rsi,%r15), %ebx
callq 0x1100
movl %eax, %ebp
movl %ebx, %edi
callq 0x1100
cmpl %eax, %ebp
jl 0x16c2
jg 0x16c9
incq %r15
cmpq %r15, %r14
movq 0x8(%rsp), %rsi
jne 0x168b
movq 0x28(%rsp), %rax
cmpq 0x30(%rsp), %rax
je 0x16c9
movl $0x18, %eax
jmp 0x16d3
movl $0x10, %eax
movq %r13, 0x10(%rsp)
movq 0x8(%rsp), %rsi
movq (%r13,%rax), %r13
jmp 0x165e
movq 0x40(%rsp), %rcx
testq %rcx, %rcx
je 0x179c
movq 0x20(%rcx), %r14
movq 0x28(%rcx), %rax
movq 0x20(%rsp), %r13
cmpq %r13, %rax
cmovlq %rax, %r13
movq %r14, %rdx
testq %r13, %r13
je 0x1758
movq %rax, 0x30(%rsp)
movq %rcx, %r12
leaq (%r14,%r13), %rax
movq %rax, 0x28(%rsp)
xorl %r15d, %r15d
movsbl (%rsi,%r15), %edi
movsbl (%r14,%r15), %ebx
callq 0x1100
movl %eax, %ebp
movl %ebx, %edi
callq 0x1100
cmpl %eax, %ebp
jl 0x1777
movq 0x8(%rsp), %rsi
jg 0x176b
incq %r15
cmpq %r15, %r13
jne 0x1720
movq %r12, %rcx
movq 0x30(%rsp), %rax
movq 0x28(%rsp), %rdx
addq %rax, %r14
movl $0x10, %eax
movq %rcx, %r12
movq %rcx, %rbx
cmpq %r14, %rdx
jne 0x1784
movl $0x18, %eax
movq 0x18(%rsp), %rbx
jmp 0x1784
movl $0x10, %eax
movq %r12, %rbx
movq 0x8(%rsp), %rsi
movq (%r12,%rax), %rcx
movq %rbx, 0x18(%rsp)
testq %rcx, %rcx
jne 0x16f0
jmp 0x17a1
xorl %ebp, %ebp
jmp 0x17ce
movq 0x18(%rsp), %rbx
movq 0x10(%rsp), %rax
xorl %ebp, %ebp
leaq 0x70(%rsp), %r15
cmpq %rbx, %rax
je 0x17c9
movq 0x38(%rsp), %r12
movq %rax, %rdi
callq 0x10f0
incq %rbp
cmpq %rbx, %rax
jne 0x17b7
jmp 0x17ce
movq 0x38(%rsp), %r12
leaq 0x20(%r12), %rdi
movl $0x4, %ecx
leaq 0x825(%rip), %rsi       # 0x2004
xorl %edx, %edx
callq 0x1140
cmpq $-0x1, %rax
je 0x18a2
cmpq $0x2, %rbp
jb 0x1848
movq %rbp, %rsi
shrq %rsi
movq 0x27cd(%rip), %rdi      # 0x3fd0
callq 0x1070
movb $0x7c, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7(%rsp), %rsi
callq 0x10e0
movq 0x20(%r12), %rsi
movq 0x28(%r12), %rdx
movq %rax, %rdi
callq 0x10e0
movb $0xa, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7(%rsp), %rsi
callq 0x10e0
testb $0x1, %bpl
je 0x18f1
movq 0x2777(%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 0x20(%r12), %rsi
movq 0x28(%r12), %rdx
movq %rax, %rdi
callq 0x10e0
movb $0xa, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7(%rsp), %rsi
callq 0x10e0
jmp 0x18f1
movq 0x2727(%rip), %rdi      # 0x3fd0
movq %rbp, %rsi
callq 0x1070
movb $0x7c, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7(%rsp), %rsi
callq 0x10e0
movq 0x20(%r12), %rsi
movq 0x28(%r12), %rdx
movq %rax, %rdi
callq 0x10e0
movb $0xa, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7(%rsp), %rsi
callq 0x10e0
movq 0x78(%rsp), %r13
testq %r13, %r13
je 0x19c7
movq 0x20(%r12), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%r12), %rax
movq %rax, 0x18(%rsp)
movq %r13, 0x10(%rsp)
movq %r15, %r12
movq %r12, 0x20(%rsp)
movq 0x20(%r13), %r14
movq 0x28(%r13), %rax
movq 0x18(%rsp), %r12
cmpq %r12, %rax
cmovlq %rax, %r12
movq %r14, %rcx
testq %r12, %r12
je 0x1982
movq %rax, 0x30(%rsp)
leaq (%r14,%r12), %rax
movq %rax, 0x28(%rsp)
xorl %r15d, %r15d
movq 0x8(%rsp), %rax
movsbl (%rax,%r15), %edi
movsbl (%r14,%r15), %ebx
callq 0x1100
movl %eax, %ebp
movl %ebx, %edi
callq 0x1100
cmpl %eax, %ebp
jl 0x199e
jg 0x1992
incq %r15
cmpq %r15, %r12
jne 0x194d
movq 0x30(%rsp), %rax
movq 0x28(%rsp), %rcx
addq %rax, %r14
movl $0x10, %eax
movq %r13, %r12
cmpq %r14, %rcx
jne 0x19a6
movl $0x18, %eax
movq 0x20(%rsp), %r12
jmp 0x19a6
movl $0x10, %eax
movq %r13, %r12
movq (%r13,%rax), %r13
testq %r13, %r13
jne 0x191b
leaq 0x70(%rsp), %r15
cmpq %r15, %r12
movq 0x10(%rsp), %rax
jne 0x1517
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x19e3
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x10d0
movq 0x78(%rsp), %rdi
callq 0x1a60
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 %rbp, %rdi
callq 0x10d0
callq 0x1110
movq %rax, %rbx
callq 0x1130
jmp 0x1a32
movq %rax, %rdi
callq 0x1aae
jmp 0x1a2f
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x1a4e
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x10d0
movq 0x78(%rsp), %rdi
callq 0x1a60
movq %rbx, %rdi
callq 0x1150