class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: F = None
        self.w: F = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

j = A("j")
e = B("e")
h = C("h")
f = D("f")
b = E("b")
k = F("k")
l = F("l")

j.r = h
j.q = h
j.u = l
j.w = l
e.t = h
e.o = b
e.u = j
h.z = e
h.q = b
h.y = j
h.v = j
h.o = l
f.q = h
b.x = h
b.s = f
b.z = f
b.r = k
b.y = e
b.w = j
k.v = f
k.p = f
k.z = j
k.s = b
l.v = f
l.p = f
l.z = j
l.s = b
assert b.w.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: F = None
        self.w: F = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

j = A("j")
e = B("e")
h = C("h")
f = D("f")
b = E("b")
k = F("k")
l = F("l")

j.r = h
j.q = h
j.u = l
j.w = l
e.t = h
e.o = b
e.u = j
h.z = e
h.q = b
h.y = j
h.v = j
h.o = l
f.q = h
b.x = h
b.s = f
b.z = f
b.r = k
b.y = e
b.w = j
k.v = f
k.p = f
k.z = j
k.s = b
l.v = f
l.p = f
l.z = j
l.s = b
assert b.w.q.q.txt == "b"