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

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

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

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

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

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

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

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

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

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

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

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

h.s = a
h.q = m
h.w = b
k.t = c
k.z = a
k.x = m
m.w = c
m.t = b
c.x = m
a.x = k
a.u = b
a.o = b
a.y = b
a.r = h
b.t = c
b.z = a
b.x = m
i.s = a
i.q = m
i.w = k
assert c.x.t.z.u.x.t.t.txt == "c"