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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: A = None
        self.y: B = None
        self.w: D = None
        self.r: B = None
        self.txt = txt

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

h = A("h")
i = B("i")
f = C("f")
n = D("n")
a = E("a")
j = B("j")
g = C("g")
k = D("k")

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: A = None
        self.y: B = None
        self.w: D = None
        self.r: B = None
        self.txt = txt

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

h = A("h")
i = B("i")
f = C("f")
n = D("n")
a = E("a")
j = B("j")
g = C("g")
k = D("k")

h.v = i
h.q = i
h.z = a
i.u = a
i.q = k
i.x = j
f.r = i
f.v = n
f.t = j
n.o = j
n.y = j
n.u = h
n.w = k
n.r = i
a.x = g
a.r = n
j.u = a
j.q = n
j.x = i
g.r = i
g.t = i
g.v = k
k.o = j
k.u = h
k.y = i
k.r = i
k.w = n
assert j.x.u.x.t.q.u.txt == "h"