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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: E = None
        self.u: D = None
        self.q: D = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

e = A("e")
d = B("d")
h = C("h")
c = D("c")
g = E("g")
k = F("k")
b = E("b")
l = D("l")

e.t = k
d.z = b
d.t = e
h.q = k
c.z = d
c.r = b
c.y = h
c.s = k
c.q = g
c.o = e
g.s = e
g.p = e
g.r = b
g.u = c
g.q = c
k.q = l
b.s = e
b.p = e
b.r = g
b.u = c
b.q = l
l.z = d
l.r = g
l.y = h
l.s = k
l.q = b
l.o = e
assert d.z.u.s.q.r.s.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: E = None
        self.u: D = None
        self.q: D = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

e = A("e")
d = B("d")
h = C("h")
c = D("c")
g = E("g")
k = F("k")
b = E("b")
l = D("l")

e.t = k
d.z = b
d.t = e
h.q = k
c.z = d
c.r = b
c.y = h
c.s = k
c.q = g
c.o = e
g.s = e
g.p = e
g.r = b
g.u = c
g.q = c
k.q = l
b.s = e
b.p = e
b.r = g
b.u = c
b.q = l
l.z = d
l.r = g
l.y = h
l.s = k
l.q = b
l.o = e
assert d.z.u.s.q.r.s.t.q.txt == "l"