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

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

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

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

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

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

g = A("g")
n = B("n")
i = C("i")
j = D("j")
b = E("b")
e = F("e")

g.s = n
g.v = i
g.x = i
g.w = i
g.p = j
g.z = b
n.v = b
n.o = b
n.x = g
n.u = j
n.w = e
i.t = e
i.u = e
i.o = g
j.t = e
b.w = i
b.t = i
b.q = n
b.o = n
b.s = g
b.x = j
e.o = j
assert e.o.t.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: C = None
        self.x: C = None
        self.p: D = None
        self.w: C = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

g = A("g")
n = B("n")
i = C("i")
j = D("j")
b = E("b")
e = F("e")

g.s = n
g.v = i
g.x = i
g.w = i
g.p = j
g.z = b
n.v = b
n.o = b
n.x = g
n.u = j
n.w = e
i.t = e
i.u = e
i.o = g
j.t = e
b.w = i
b.t = i
b.q = n
b.o = n
b.s = g
b.x = j
e.o = j
assert e.o.t.o.t.txt == "e"