class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: D = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: E = None
        self.o: B = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: B = None
        self.t: B = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: E = None
        self.x: A = None
        self.u: F = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: D = None
        self.txt = txt

c = A("c")
h = B("h")
a = C("a")
l = D("l")
n = E("n")
d = F("d")
e = D("e")
m = E("m")

c.o = a
h.x = e
h.y = e
h.t = l
a.s = h
a.o = h
a.z = n
a.r = l
l.r = a
l.q = h
l.t = h
l.y = h
n.y = a
n.t = m
n.x = c
n.u = d
n.q = h
d.t = h
d.w = l
e.r = a
e.q = h
e.t = h
e.y = h
m.y = a
m.t = n
m.x = c
m.u = d
m.q = h
assert m.t.u.t.t.r.r.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: D = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: E = None
        self.o: B = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: B = None
        self.t: B = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: E = None
        self.x: A = None
        self.u: F = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: D = None
        self.txt = txt

c = A("c")
h = B("h")
a = C("a")
l = D("l")
n = E("n")
d = F("d")
e = D("e")
m = E("m")

c.o = a
h.x = e
h.y = e
h.t = l
a.s = h
a.o = h
a.z = n
a.r = l
l.r = a
l.q = h
l.t = h
l.y = h
n.y = a
n.t = m
n.x = c
n.u = d
n.q = h
d.t = h
d.w = l
e.r = a
e.q = h
e.t = h
e.y = h
m.y = a
m.t = n
m.x = c
m.u = d
m.q = h
assert m.t.u.t.t.r.r.y.t.txt == "l"