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

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: G = None
        self.y: G = None
        self.t: E = None
        self.o: D = None
        self.r: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: H = None
        self.z: B = None
        self.v: H = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

f = A("f")
n = B("n")
l = C("l")
c = D("c")
g = E("g")
j = F("j")
e = G("e")
k = H("k")
i = B("i")
b = D("b")

f.t = j
f.y = l
f.u = k
f.o = i
n.s = l
l.v = g
c.z = j
c.v = e
c.y = e
c.r = e
c.t = g
c.o = b
g.t = j
j.r = f
j.w = k
j.v = k
j.z = n
j.s = e
e.z = k
k.p = e
i.s = l
b.z = j
b.v = e
b.y = e
b.r = e
b.t = g
b.o = c
assert k.p.z.p.z.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: C = None
        self.u: H = None
        self.o: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: G = None
        self.y: G = None
        self.t: E = None
        self.o: D = None
        self.r: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: H = None
        self.z: B = None
        self.v: H = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

f = A("f")
n = B("n")
l = C("l")
c = D("c")
g = E("g")
j = F("j")
e = G("e")
k = H("k")
i = B("i")
b = D("b")

f.t = j
f.y = l
f.u = k
f.o = i
n.s = l
l.v = g
c.z = j
c.v = e
c.y = e
c.r = e
c.t = g
c.o = b
g.t = j
j.r = f
j.w = k
j.v = k
j.z = n
j.s = e
e.z = k
k.p = e
i.s = l
b.z = j
b.v = e
b.y = e
b.r = e
b.t = g
b.o = c
assert k.p.z.p.z.p.z.txt == "k"