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

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

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

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

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

c = A("c")
h = B("h")
e = C("e")
k = D("k")
l = E("l")
d = A("d")

c.q = k
c.y = e
c.o = d
h.w = k
e.t = c
k.u = h
k.s = h
k.v = e
k.y = e
l.w = k
d.q = k
d.y = e
d.o = c
assert k.v.t.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: C = None
        self.o: A = None
        self.txt = txt

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

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

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

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

c = A("c")
h = B("h")
e = C("e")
k = D("k")
l = E("l")
d = A("d")

c.q = k
c.y = e
c.o = d
h.w = k
e.t = c
k.u = h
k.s = h
k.v = e
k.y = e
l.w = k
d.q = k
d.y = e
d.o = c
assert k.v.t.y.t.txt == "c"