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

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

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

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

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

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

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

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

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

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

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

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

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