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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

i = A("i")
b = B("b")
c = C("c")
l = D("l")
e = E("e")
n = B("n")
f = D("f")
j = A("j")
m = C("m")
a = E("a")

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

i = A("i")
b = B("b")
c = C("c")
l = D("l")
e = E("e")
n = B("n")
f = D("f")
j = A("j")
m = C("m")
a = E("a")

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