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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: A = None
        self.s: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: C = None
        self.t: F = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: A = None
        self.s: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: C = None
        self.t: F = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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