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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: E = None
        self.s: F = None
        self.x: D = None
        self.txt = txt

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

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

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

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

i = A("i")
b = B("b")
m = C("m")
j = D("j")
d = E("d")
k = F("k")
c = A("c")
l = E("l")

i.s = j
b.z = i
b.v = l
b.s = k
b.x = j
m.y = l
m.q = l
m.u = d
m.v = j
j.s = i
j.v = b
j.w = k
d.y = l
d.o = l
d.p = l
d.w = m
d.s = b
k.t = c
k.u = b
c.s = j
l.y = d
l.o = d
l.p = d
l.w = m
l.s = b
assert i.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: E = None
        self.s: F = None
        self.x: D = None
        self.txt = txt

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

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

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

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

i = A("i")
b = B("b")
m = C("m")
j = D("j")
d = E("d")
k = F("k")
c = A("c")
l = E("l")

i.s = j
b.z = i
b.v = l
b.s = k
b.x = j
m.y = l
m.q = l
m.u = d
m.v = j
j.s = i
j.v = b
j.w = k
d.y = l
d.o = l
d.p = l
d.w = m
d.s = b
k.t = c
k.u = b
c.s = j
l.y = d
l.o = d
l.p = d
l.w = m
l.s = b
assert i.s.s.s.txt == "j"