class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: F = None
        self.u: E = None
        self.r: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: D = None
        self.p: C = None
        self.u: B = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: D = None
        self.p: C = None
        self.u: B = None
        self.x: D = None
        self.txt = txt

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

f.z = g
f.w = b
f.r = b
f.u = j
a.o = f
a.t = j
a.s = d
a.p = k
n.s = i
n.u = a
n.v = j
d.q = i
d.u = b
j.o = i
b.o = g
b.z = i
b.x = i
b.p = n
b.u = a
k.o = n
k.z = i
k.x = i
k.p = g
k.u = a
i.q = d
i.u = k
g.s = d
g.u = a
g.v = j
assert b.o.u.o.r.x.u.o.txt == "n"