class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: A = None
        self.txt = txt

c = A("c")
n = B("n")
l = B("l")
d = B("d")
a = B("a")
k = A("k")
m = A("m")
h = A("h")

c.t = h
c.u = m
n.s = l
n.x = m
l.s = a
l.x = k
d.s = a
d.x = m
a.s = l
a.x = k
k.t = h
k.u = m
m.t = c
m.u = k
h.t = k
h.u = m
assert c.t.u.u.t.u.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: A = None
        self.txt = txt

c = A("c")
n = B("n")
l = B("l")
d = B("d")
a = B("a")
k = A("k")
m = A("m")
h = A("h")

c.t = h
c.u = m
n.s = l
n.x = m
l.s = a
l.x = k
d.s = a
d.x = m
a.s = l
a.x = k
k.t = h
k.u = m
m.t = c
m.u = k
h.t = k
h.u = m
assert c.t.u.u.t.u.u.t.txt == "h"