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

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: E = None
        self.w: E = None
        self.o: C = None
        self.s: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: A = None
        self.z: D = None
        self.txt = txt

f = A("f")
j = B("j")
b = C("b")
e = D("e")
l = E("l")
d = A("d")
c = B("c")
k = D("k")
m = E("m")

f.u = b
f.t = m
j.u = k
b.q = l
b.r = e
b.v = j
e.x = d
e.p = l
e.w = l
e.o = b
e.s = k
l.o = e
l.z = e
l.q = d
d.u = b
d.t = l
c.u = e
k.x = f
k.p = m
k.w = m
k.o = b
k.s = e
m.o = k
m.z = k
m.q = f
assert j.u.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: E = None
        self.w: E = None
        self.o: C = None
        self.s: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: A = None
        self.z: D = None
        self.txt = txt

f = A("f")
j = B("j")
b = C("b")
e = D("e")
l = E("l")
d = A("d")
c = B("c")
k = D("k")
m = E("m")

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