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

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

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

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

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

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

h.q = j
h.r = d
h.v = a
h.x = b
h.u = k
j.x = n
j.r = n
j.p = n
j.u = g
g.r = n
g.y = n
g.t = b
g.s = k
a.q = g
a.o = m
a.x = b
n.q = m
b.r = n
b.y = n
b.t = g
b.s = k
e.r = n
e.y = n
e.t = b
e.s = k
m.q = j
m.r = d
m.v = a
m.x = e
m.u = h
k.q = j
k.r = d
k.v = a
k.x = g
k.u = m
d.x = n
d.r = n
d.p = n
d.u = b
assert d.u.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: B = None
        self.v: D = None
        self.x: C = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

h.q = j
h.r = d
h.v = a
h.x = b
h.u = k
j.x = n
j.r = n
j.p = n
j.u = g
g.r = n
g.y = n
g.t = b
g.s = k
a.q = g
a.o = m
a.x = b
n.q = m
b.r = n
b.y = n
b.t = g
b.s = k
e.r = n
e.y = n
e.t = b
e.s = k
m.q = j
m.r = d
m.v = a
m.x = e
m.u = h
k.q = j
k.r = d
k.v = a
k.x = g
k.u = m
d.x = n
d.r = n
d.p = n
d.u = b
assert d.u.t.t.t.txt == "g"