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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: D = None
        self.p: A = None
        self.txt = txt

d = A("d")
b = B("b")
m = C("m")
n = D("n")
e = E("e")
l = B("l")
a = A("a")
g = B("g")

d.q = e
d.x = e
d.w = m
d.v = m
d.o = n
b.t = d
b.r = d
b.o = m
b.q = m
b.v = g
m.o = n
m.q = e
m.z = b
m.v = b
m.t = a
n.t = l
e.w = g
e.y = n
e.p = a
l.t = a
l.r = d
l.o = m
l.q = m
l.v = g
a.q = e
a.x = e
a.w = m
a.v = m
a.o = n
g.t = d
g.r = a
g.o = m
g.q = m
g.v = b
assert d.o.t.v.t.q.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: E = None
        self.w: C = None
        self.o: D = None
        self.v: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: D = None
        self.p: A = None
        self.txt = txt

d = A("d")
b = B("b")
m = C("m")
n = D("n")
e = E("e")
l = B("l")
a = A("a")
g = B("g")

d.q = e
d.x = e
d.w = m
d.v = m
d.o = n
b.t = d
b.r = d
b.o = m
b.q = m
b.v = g
m.o = n
m.q = e
m.z = b
m.v = b
m.t = a
n.t = l
e.w = g
e.y = n
e.p = a
l.t = a
l.r = d
l.o = m
l.q = m
l.v = g
a.q = e
a.x = e
a.w = m
a.v = m
a.o = n
g.t = d
g.r = a
g.o = m
g.q = m
g.v = b
assert d.o.t.v.t.q.p.o.txt == "n"