class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: C = None
        self.t: C = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

e.r = a
e.x = i
e.t = i
e.v = g
f.x = g
f.o = g
f.u = b
f.y = b
f.z = e
f.r = i
i.q = g
b.p = i
b.o = i
b.r = i
b.q = e
b.x = e
g.q = e
g.p = i
g.s = f
g.x = f
a.x = b
assert b.x.v.x.o.txt == "g"