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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: E = None
        self.q: F = None
        self.s: B = None
        self.w: D = None
        self.o: F = None
        self.txt = txt

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

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

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

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

l.y = c
c.q = n
h.p = c
h.s = c
h.y = e
h.q = n
h.o = n
h.w = i
i.t = n
i.y = c
e.v = c
e.t = c
n.q = i
n.u = l
n.r = h
assert i.t.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: E = None
        self.q: F = None
        self.s: B = None
        self.w: D = None
        self.o: F = None
        self.txt = txt

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

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

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

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

l.y = c
c.q = n
h.p = c
h.s = c
h.y = e
h.q = n
h.o = n
h.w = i
i.t = n
i.y = c
e.v = c
e.t = c
n.q = i
n.u = l
n.r = h
assert i.t.u.y.txt == "c"