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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: C = None
        self.u: B = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: C = None
        self.u: B = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

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

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