class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: F = None
        self.s: C = None
        self.t: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: F = None
        self.u: C = None
        self.v: C = None
        self.w: F = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

i = A("i")
k = B("k")
j = C("j")
c = D("c")
m = E("m")
g = F("g")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: F = None
        self.u: C = None
        self.v: C = None
        self.w: F = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

i = A("i")
k = B("k")
j = C("j")
c = D("c")
m = E("m")
g = F("g")

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