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

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

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

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

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

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

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

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

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

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

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

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

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