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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: F = None
        self.v: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: D = None
        self.u: D = None
        self.z: C = None
        self.o: E = None
        self.r: E = None
        self.txt = txt

g = A("g")
j = B("j")
e = C("e")
h = D("h")
i = E("i")
k = F("k")
a = B("a")
d = E("d")
b = D("b")
m = E("m")

g.u = h
g.v = e
g.q = b
g.y = j
j.z = e
e.w = k
e.p = k
e.v = h
h.v = e
h.y = e
h.u = a
h.p = g
h.r = i
h.o = k
i.x = j
i.t = a
k.s = e
k.z = e
k.x = h
k.u = b
k.o = m
k.r = m
a.z = e
d.x = a
d.t = a
b.v = e
b.y = e
b.u = a
b.p = g
b.r = d
b.o = k
m.x = a
m.t = j
assert m.x.z.p.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: C = None
        self.q: D = None
        self.y: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: F = None
        self.v: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: D = None
        self.u: D = None
        self.z: C = None
        self.o: E = None
        self.r: E = None
        self.txt = txt

g = A("g")
j = B("j")
e = C("e")
h = D("h")
i = E("i")
k = F("k")
a = B("a")
d = E("d")
b = D("b")
m = E("m")

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