class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: G = None
        self.r: D = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: D = None
        self.txt = txt

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

c = A("c")
d = B("d")
n = C("n")
i = D("i")
b = E("b")
m = F("m")
a = G("a")
l = A("l")

c.q = m
c.o = a
c.r = i
c.z = b
d.z = a
d.q = a
d.o = m
d.y = n
d.u = b
d.r = b
d.p = l
n.y = b
n.t = d
n.u = a
i.r = l
b.t = l
b.s = l
b.q = n
m.t = c
m.x = i
a.y = c
a.u = m
a.x = m
a.z = l
a.p = d
a.s = d
l.q = m
l.o = a
l.r = i
l.z = b
assert c.o.x.t.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: G = None
        self.r: D = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: D = None
        self.txt = txt

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

c = A("c")
d = B("d")
n = C("n")
i = D("i")
b = E("b")
m = F("m")
a = G("a")
l = A("l")

c.q = m
c.o = a
c.r = i
c.z = b
d.z = a
d.q = a
d.o = m
d.y = n
d.u = b
d.r = b
d.p = l
n.y = b
n.t = d
n.u = a
i.r = l
b.t = l
b.s = l
b.q = n
m.t = c
m.x = i
a.y = c
a.u = m
a.x = m
a.z = l
a.p = d
a.s = d
l.q = m
l.o = a
l.r = i
l.z = b
assert c.o.x.t.z.s.txt == "l"