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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: B = None
        self.txt = txt

a = A("a")
b = B("b")
k = C("k")
f = D("f")
i = E("i")
g = F("g")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: B = None
        self.txt = txt

a = A("a")
b = B("b")
k = C("k")
f = D("f")
i = E("i")
g = F("g")

a.o = k
a.r = k
a.y = b
a.t = f
a.w = f
a.x = g
b.v = i
b.t = i
b.x = f
b.z = f
b.o = k
b.p = g
k.p = b
k.t = a
k.s = i
f.o = g
i.p = a
i.z = a
g.z = k
g.x = b
assert k.s.z.x.txt == "g"