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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: G = None
        self.r: A = None
        self.s: F = None
        self.z: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: F = None
        self.p: A = None
        self.q: E = None
        self.x: C = None
        self.u: F = None
        self.o: E = None
        self.txt = txt

l = A("l")
g = B("g")
n = C("n")
k = D("k")
h = E("h")
a = F("a")
b = G("b")

l.q = a
l.p = a
l.o = k
l.r = g
g.o = l
g.u = l
g.p = n
g.s = h
g.w = b
g.r = b
n.q = b
n.r = l
n.v = a
n.x = a
k.z = l
k.s = a
k.x = h
k.r = g
k.y = n
h.p = b
h.y = b
h.r = l
h.z = l
h.s = a
a.o = n
b.y = n
b.x = n
b.v = a
b.u = a
b.p = l
b.q = h
b.o = h
assert l.r.o.p.o.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: D = None
        self.p: F = None
        self.r: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: G = None
        self.r: A = None
        self.s: F = None
        self.z: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: F = None
        self.p: A = None
        self.q: E = None
        self.x: C = None
        self.u: F = None
        self.o: E = None
        self.txt = txt

l = A("l")
g = B("g")
n = C("n")
k = D("k")
h = E("h")
a = F("a")
b = G("b")

l.q = a
l.p = a
l.o = k
l.r = g
g.o = l
g.u = l
g.p = n
g.s = h
g.w = b
g.r = b
n.q = b
n.r = l
n.v = a
n.x = a
k.z = l
k.s = a
k.x = h
k.r = g
k.y = n
h.p = b
h.y = b
h.r = l
h.z = l
h.s = a
a.o = n
b.y = n
b.x = n
b.v = a
b.u = a
b.p = l
b.q = h
b.o = h
assert l.r.o.p.o.x.o.txt == "n"