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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: A = None
        self.txt = txt

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

l = A("l")
n = B("n")
i = C("i")
f = D("f")
h = E("h")
a = F("a")

l.t = h
l.u = n
l.q = i
l.y = a
n.o = l
n.x = f
i.q = n
f.q = h
f.v = a
f.y = i
h.p = n
h.x = l
a.o = f
a.s = h
a.w = l
a.u = l
assert n.x.q.p.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: B = None
        self.q: C = None
        self.y: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: A = None
        self.txt = txt

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

l = A("l")
n = B("n")
i = C("i")
f = D("f")
h = E("h")
a = F("a")

l.t = h
l.u = n
l.q = i
l.y = a
n.o = l
n.x = f
i.q = n
f.q = h
f.v = a
f.y = i
h.p = n
h.x = l
a.o = f
a.s = h
a.w = l
a.u = l
assert n.x.q.p.o.q.txt == "i"