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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: D = None
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: B = None
        self.o: D = None
        self.q: B = None
        self.s: A = None
        self.z: A = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: D = None
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: B = None
        self.o: D = None
        self.q: B = None
        self.s: A = None
        self.z: A = None
        self.p: C = None
        self.txt = txt

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

k.z = d
k.r = a
k.s = a
k.y = c
k.o = e
k.v = e
k.x = b
m.o = a
l.o = e
l.s = m
l.x = b
l.v = k
l.p = c
d.r = c
d.y = c
c.o = e
b.x = d
b.z = d
b.p = e
e.t = k
e.s = k
e.z = k
e.y = a
e.q = a
e.o = d
e.p = l
a.o = m
assert a.o.o.o.txt == "m"