class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: C = None
        self.u: C = None
        self.q: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: A = None
        self.r: B = None
        self.s: B = None
        self.u: D = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: A = None
        self.u: B = None
        self.z: C = None
        self.txt = txt

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

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

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

k.o = i
k.t = g
k.u = g
k.q = j
j.w = f
g.w = k
g.q = k
g.r = j
g.s = j
g.u = i
g.v = f
i.w = g
i.z = g
i.y = k
i.u = j
f.p = i
l.x = i
l.t = i
l.w = j
l.o = f
assert i.u.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: C = None
        self.u: C = None
        self.q: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: A = None
        self.r: B = None
        self.s: B = None
        self.u: D = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: A = None
        self.u: B = None
        self.z: C = None
        self.txt = txt

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

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

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

k.o = i
k.t = g
k.u = g
k.q = j
j.w = f
g.w = k
g.q = k
g.r = j
g.s = j
g.u = i
g.v = f
i.w = g
i.z = g
i.y = k
i.u = j
f.p = i
l.x = i
l.t = i
l.w = j
l.o = f
assert i.u.w.p.txt == "i"