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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: B = None
        self.y: F = None
        self.q: B = None
        self.txt = txt

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

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

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

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

e.t = f
e.w = l
e.s = c
l.t = h
n.t = e
n.z = l
n.q = l
n.y = f
c.q = f
c.p = n
h.q = f
f.w = e
f.s = c
f.q = n
f.x = l
assert f.q.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: B = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: B = None
        self.y: F = None
        self.q: B = None
        self.txt = txt

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

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

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

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

e.t = f
e.w = l
e.s = c
l.t = h
n.t = e
n.z = l
n.q = l
n.y = f
c.q = f
c.p = n
h.q = f
f.w = e
f.s = c
f.q = n
f.x = l
assert f.q.q.t.txt == "h"