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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: D = None
        self.z: G = None
        self.p: A = None
        self.u: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: B = None
        self.x: B = None
        self.o: C = None
        self.txt = txt

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

m.z = e
k.s = a
k.r = b
k.z = j
g.y = k
e.x = k
e.q = k
e.z = l
e.y = g
l.s = b
l.o = e
l.u = e
l.z = a
l.p = m
j.x = g
a.s = k
a.t = k
a.x = k
a.o = g
b.z = e
assert l.o.q.s.o.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: D = None
        self.z: G = None
        self.p: A = None
        self.u: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: B = None
        self.x: B = None
        self.o: C = None
        self.txt = txt

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

m.z = e
k.s = a
k.r = b
k.z = j
g.y = k
e.x = k
e.q = k
e.z = l
e.y = g
l.s = b
l.o = e
l.u = e
l.z = a
l.p = m
j.x = g
a.s = k
a.t = k
a.x = k
a.o = g
b.z = e
assert l.o.q.s.o.y.z.txt == "j"