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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: A = None
        self.p: E = None
        self.txt = txt

i = A("i")
h = B("h")
l = C("l")
g = D("g")
k = E("k")
f = F("f")
b = C("b")
m = E("m")
a = F("a")

i.s = a
h.o = i
h.q = k
l.t = g
g.y = h
k.v = i
k.z = h
k.t = b
k.p = m
f.z = g
f.v = i
f.p = k
b.t = g
m.v = i
m.z = h
m.t = b
m.p = k
a.z = g
a.v = i
a.p = k
assert h.q.t.t.y.o.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: A = None
        self.p: E = None
        self.txt = txt

i = A("i")
h = B("h")
l = C("l")
g = D("g")
k = E("k")
f = F("f")
b = C("b")
m = E("m")
a = F("a")

i.s = a
h.o = i
h.q = k
l.t = g
g.y = h
k.v = i
k.z = h
k.t = b
k.p = m
f.z = g
f.v = i
f.p = k
b.t = g
m.v = i
m.z = h
m.t = b
m.p = k
a.z = g
a.v = i
a.p = k
assert h.q.t.t.y.o.s.z.txt == "g"