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

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

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

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

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

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

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

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

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

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

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

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

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

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

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