class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

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

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

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

h = A("h")
e = B("e")
c = C("c")
l = D("l")
k = E("k")
b = F("b")
i = C("i")

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

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

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

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

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

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

h = A("h")
e = B("e")
c = C("c")
l = D("l")
k = E("k")
b = F("b")
i = C("i")

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