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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: B = None
        self.q: G = None
        self.o: C = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: B = None
        self.q: G = None
        self.o: C = None
        self.v: F = None
        self.txt = txt

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

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

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

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