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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: B = None
        self.z: A = None
        self.p: C = None
        self.txt = txt

l = A("l")
e = B("e")
k = C("k")
i = D("i")
f = E("f")
h = F("h")
g = F("g")

l.t = i
l.w = k
l.q = f
e.w = l
e.z = i
e.p = h
k.o = e
k.t = l
k.z = f
i.o = h
i.t = h
f.q = i
h.o = k
h.p = k
h.v = e
h.z = l
g.o = k
g.p = k
g.v = e
g.z = l
assert g.z.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: C = None
        self.q: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: B = None
        self.z: A = None
        self.p: C = None
        self.txt = txt

l = A("l")
e = B("e")
k = C("k")
i = D("i")
f = E("f")
h = F("h")
g = F("g")

l.t = i
l.w = k
l.q = f
e.w = l
e.z = i
e.p = h
k.o = e
k.t = l
k.z = f
i.o = h
i.t = h
f.q = i
h.o = k
h.p = k
h.v = e
h.z = l
g.o = k
g.p = k
g.v = e
g.z = l
assert g.z.t.t.txt == "h"