class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: D = None
        self.p: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: D = None
        self.u: G = None
        self.x: E = None
        self.t: F = None
        self.s: A = None
        self.txt = txt

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

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

n = A("n")
f = B("f")
e = C("e")
l = D("l")
m = E("m")
g = F("g")
h = G("h")
a = D("a")
c = E("c")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: D = None
        self.u: G = None
        self.x: E = None
        self.t: F = None
        self.s: A = None
        self.txt = txt

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

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

n = A("n")
f = B("f")
e = C("e")
l = D("l")
m = E("m")
g = F("g")
h = G("h")
a = D("a")
c = E("c")

n.t = f
n.r = a
n.p = l
f.u = e
e.o = n
e.u = l
e.q = f
e.y = m
e.x = g
l.q = f
m.p = n
m.s = n
m.y = l
m.u = h
m.x = c
m.t = g
g.s = a
g.w = a
g.o = m
g.y = n
g.v = n
g.z = l
h.p = g
a.q = f
c.p = n
c.s = n
c.y = a
c.u = h
c.x = m
c.t = g
assert f.u.y.y.q.u.y.txt == "m"