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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: E = None
        self.w: C = None
        self.q: D = None
        self.z: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: B = None
        self.y: D = None
        self.s: D = None
        self.w: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: E = None
        self.w: C = None
        self.q: D = None
        self.z: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: B = None
        self.y: D = None
        self.s: D = None
        self.w: A = None
        self.txt = txt

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

a.x = n
a.y = n
a.r = c
h.p = f
h.v = f
h.u = c
h.t = k
e.r = k
e.p = n
e.w = f
e.z = f
e.q = i
m.y = e
m.u = f
n.o = m
n.s = m
n.x = h
n.y = i
n.w = a
k.p = f
k.v = f
k.u = c
k.t = h
f.r = h
f.p = n
f.w = e
f.z = e
f.q = i
i.y = f
i.u = e
c.x = n
c.y = n
c.r = a
assert f.r.t.p.z.txt == "e"