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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: A = None
        self.o: E = None
        self.u: D = None
        self.y: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: E = None
        self.q: C = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: C = None
        self.q: B = None
        self.txt = txt

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

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

k.t = c
g.v = h
g.y = h
g.s = k
g.o = a
g.u = i
c.z = k
e.x = c
e.q = c
e.y = a
e.p = k
a.p = k
a.v = c
a.q = g
h.s = g
l.v = h
l.y = h
l.s = k
l.o = a
l.u = e
i.x = c
i.q = c
i.y = a
i.p = k
d.x = c
d.q = c
d.y = a
d.p = k
assert l.s.t.z.t.z.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: A = None
        self.o: E = None
        self.u: D = None
        self.y: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: E = None
        self.q: C = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: C = None
        self.q: B = None
        self.txt = txt

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

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

k.t = c
g.v = h
g.y = h
g.s = k
g.o = a
g.u = i
c.z = k
e.x = c
e.q = c
e.y = a
e.p = k
a.p = k
a.v = c
a.q = g
h.s = g
l.v = h
l.y = h
l.s = k
l.o = a
l.u = e
i.x = c
i.q = c
i.y = a
i.p = k
d.x = c
d.q = c
d.y = a
d.p = k
assert l.s.t.z.t.z.t.z.txt == "k"