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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: C = None
        self.p: D = None
        self.txt = txt

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

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

f.t = g
f.u = g
f.x = a
f.r = m
h.q = e
h.v = e
h.u = g
h.x = g
h.r = n
g.v = n
g.t = n
e.y = g
e.v = g
e.p = j
l.t = d
l.q = m
l.v = f
d.t = g
d.u = g
d.x = a
d.r = m
a.t = d
a.v = d
a.q = l
m.t = d
m.q = a
m.v = f
n.q = e
n.u = g
n.x = g
n.r = h
n.v = j
j.y = g
j.v = g
j.p = e
assert m.q.v.t.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: C = None
        self.x: E = None
        self.r: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: C = None
        self.p: D = None
        self.txt = txt

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

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

f.t = g
f.u = g
f.x = a
f.r = m
h.q = e
h.v = e
h.u = g
h.x = g
h.r = n
g.v = n
g.t = n
e.y = g
e.v = g
e.p = j
l.t = d
l.q = m
l.v = f
d.t = g
d.u = g
d.x = a
d.r = m
a.t = d
a.v = d
a.q = l
m.t = d
m.q = a
m.v = f
n.q = e
n.u = g
n.x = g
n.r = h
n.v = j
j.y = g
j.v = g
j.p = e
assert m.q.v.t.v.v.txt == "j"