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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

g = A("g")
m = B("m")
a = C("a")
i = D("i")
f = E("f")
j = F("j")

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

g = A("g")
m = B("m")
a = C("a")
i = D("i")
f = E("f")
j = F("j")

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