class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: B = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: G = None
        self.p: G = None
        self.o: G = None
        self.u: G = None
        self.t: A = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: B = None
        self.x: D = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: C = None
        self.z: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: G = None
        self.p: G = None
        self.o: G = None
        self.u: G = None
        self.t: A = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: B = None
        self.x: D = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: C = None
        self.z: B = None
        self.txt = txt

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

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