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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: E = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: E = None
        self.y: A = None
        self.txt = txt

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

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

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

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

h.t = c
h.v = f
h.q = f
h.w = f
h.s = k
c.t = l
c.s = l
c.y = h
f.r = h
k.o = h
l.q = c
l.y = k
l.o = f
l.v = h
assert l.o.r.t.y.txt == "h"