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

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

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

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

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

h = A("h")
i = B("i")
f = C("f")
k = D("k")
c = E("c")
g = E("g")
n = E("n")
m = A("m")
b = D("b")

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

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

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

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

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

h = A("h")
i = B("i")
f = C("f")
k = D("k")
c = E("c")
g = E("g")
n = E("n")
m = A("m")
b = D("b")

h.t = g
h.x = k
h.w = f
h.z = i
i.r = f
i.u = f
i.s = c
i.t = h
i.w = k
f.t = c
f.r = c
f.x = h
k.y = m
k.t = h
k.v = f
k.s = i
c.v = m
c.r = m
c.z = m
g.v = m
g.r = h
g.z = h
n.v = m
n.r = m
n.z = m
m.t = n
m.x = k
m.w = f
m.z = i
b.y = h
b.t = h
b.v = f
b.s = i
assert h.z.u.x.z.u.txt == "f"