class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: C = None
        self.v: D = None
        self.o: E = None
        self.w: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: B = None
        self.z: E = None
        self.txt = txt

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

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

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

h.t = g
h.o = g
h.w = g
h.r = n
h.v = a
j.r = f
j.x = g
n.w = g
n.z = g
n.s = f
d.s = j
d.v = m
d.y = b
g.z = f
g.t = h
f.r = j
f.x = g
m.s = j
m.v = d
m.y = n
a.s = j
a.v = d
a.y = n
b.w = g
b.z = g
b.s = j
c.t = g
c.o = g
c.w = g
c.r = n
c.v = d
assert n.w.z.r.x.z.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: C = None
        self.v: D = None
        self.o: E = None
        self.w: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: B = None
        self.z: E = None
        self.txt = txt

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

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

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

h.t = g
h.o = g
h.w = g
h.r = n
h.v = a
j.r = f
j.x = g
n.w = g
n.z = g
n.s = f
d.s = j
d.v = m
d.y = b
g.z = f
g.t = h
f.r = j
f.x = g
m.s = j
m.v = d
m.y = n
a.s = j
a.v = d
a.y = n
b.w = g
b.z = g
b.s = j
c.t = g
c.o = g
c.w = g
c.r = n
c.v = d
assert n.w.z.r.x.z.x.t.txt == "h"