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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: D = None
        self.y: D = None
        self.x: B = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: D = None
        self.y: D = None
        self.x: B = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: A = None
        self.txt = txt

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

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