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

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

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

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

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

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

h.q = c
n.y = l
n.o = f
n.u = h
n.s = h
n.t = c
b.u = l
b.o = c
l.o = c
l.u = c
l.y = h
c.r = n
c.t = h
c.v = b
f.o = c
f.u = c
f.y = h
assert h.q.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

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

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

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

h.q = c
n.y = l
n.o = f
n.u = h
n.s = h
n.t = c
b.u = l
b.o = c
l.o = c
l.u = c
l.y = h
c.r = n
c.t = h
c.v = b
f.o = c
f.u = c
f.y = h
assert h.q.t.q.txt == "c"