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

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

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

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

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

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

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

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

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

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

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

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

d.x = n
d.w = g
d.p = l
i.t = f
i.s = f
i.z = f
i.q = d
i.u = e
f.p = d
f.y = i
f.v = m
f.t = g
f.x = j
l.q = m
m.v = i
m.x = l
m.t = l
m.s = l
m.r = j
e.v = g
e.x = l
e.r = l
e.s = l
e.t = j
g.t = f
g.s = f
g.z = f
g.q = n
g.u = e
n.x = d
n.w = g
n.p = j
j.q = e
b.t = f
b.s = f
b.z = f
b.q = d
b.u = e
assert d.x.p.q.t.q.t.q.v.q.txt == "n"