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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: D = None
        self.s: E = None
        self.p: D = None
        self.r: D = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: D = None
        self.s: E = None
        self.p: D = None
        self.r: D = None
        self.x: E = None
        self.txt = txt

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

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