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

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: A = None
        self.r: C = None
        self.o: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: B = None
        self.y: F = None
        self.w: C = None
        self.z: A = None
        self.x: F = None
        self.txt = txt

k = A("k")
d = B("d")
a = C("a")
j = D("j")
f = E("f")
n = F("n")
g = F("g")
l = B("l")
e = A("e")

k.s = g
d.q = l
d.w = e
d.r = a
d.o = j
a.w = j
j.u = n
j.o = n
f.p = d
f.u = e
n.t = j
n.s = l
n.y = g
n.x = g
n.w = a
n.z = k
g.t = j
g.s = d
g.y = n
g.x = n
g.w = a
g.z = e
l.q = d
l.w = k
l.r = a
l.o = j
e.s = g
assert f.p.o.u.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: A = None
        self.r: C = None
        self.o: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: B = None
        self.y: F = None
        self.w: C = None
        self.z: A = None
        self.x: F = None
        self.txt = txt

k = A("k")
d = B("d")
a = C("a")
j = D("j")
f = E("f")
n = F("n")
g = F("g")
l = B("l")
e = A("e")

k.s = g
d.q = l
d.w = e
d.r = a
d.o = j
a.w = j
j.u = n
j.o = n
f.p = d
f.u = e
n.t = j
n.s = l
n.y = g
n.x = g
n.w = a
n.z = k
g.t = j
g.s = d
g.y = n
g.x = n
g.w = a
g.z = e
l.q = d
l.w = k
l.r = a
l.o = j
e.s = g
assert f.p.o.u.z.s.txt == "g"