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

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

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

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

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

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

l.q = n
n.y = k
n.o = g
n.u = m
n.q = m
n.v = j
j.r = l
j.q = l
j.w = i
j.t = m
j.u = f
i.o = c
i.x = n
i.w = n
m.y = l
m.x = e
m.t = k
e.r = k
e.q = k
e.w = g
e.t = m
e.u = j
k.q = n
f.r = l
f.q = l
f.w = c
f.t = m
f.u = j
g.o = c
g.x = n
g.w = n
c.o = i
c.x = n
c.w = n
assert f.u.t.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

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

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

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

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

l.q = n
n.y = k
n.o = g
n.u = m
n.q = m
n.v = j
j.r = l
j.q = l
j.w = i
j.t = m
j.u = f
i.o = c
i.x = n
i.w = n
m.y = l
m.x = e
m.t = k
e.r = k
e.q = k
e.w = g
e.t = m
e.u = j
k.q = n
f.r = l
f.q = l
f.w = c
f.t = m
f.u = j
g.o = c
g.x = n
g.w = n
c.o = i
c.x = n
c.w = n
assert f.u.t.x.w.txt == "g"