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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: C = None
        self.x: H = None
        self.v: C = None
        self.r: A = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: B = None
        self.r: B = None
        self.p: G = None
        self.o: E = None
        self.w: A = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.y: A = None
        self.o: C = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: E = None
        self.p: E = None
        self.txt = txt

m = A("m")
l = B("l")
g = C("g")
k = D("k")
b = E("b")
a = F("a")
i = G("i")
e = H("e")
n = G("n")
f = E("f")

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: C = None
        self.x: H = None
        self.v: C = None
        self.r: A = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: B = None
        self.r: B = None
        self.p: G = None
        self.o: E = None
        self.w: A = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.y: A = None
        self.o: C = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: E = None
        self.p: E = None
        self.txt = txt

m = A("m")
l = B("l")
g = C("g")
k = D("k")
b = E("b")
a = F("a")
i = G("i")
e = H("e")
n = G("n")
f = E("f")

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