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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: D = None
        self.q: G = None
        self.r: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: A = None
        self.q: B = None
        self.x: D = None
        self.txt = txt

k = A("k")
c = B("c")
a = C("a")
i = D("i")
m = E("m")
g = F("g")
j = G("j")

k.y = j
k.x = j
k.s = c
k.o = m
k.z = m
k.r = g
k.p = a
c.w = m
c.s = i
c.q = j
c.r = a
a.o = g
i.r = a
m.p = g
m.x = c
m.q = i
m.o = j
m.s = k
g.x = m
g.s = m
g.r = k
g.u = c
j.v = k
j.z = k
j.q = c
j.x = i
assert m.q.r.o.r.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: B = None
        self.o: E = None
        self.x: G = None
        self.r: F = None
        self.z: E = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: D = None
        self.q: G = None
        self.r: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: A = None
        self.q: B = None
        self.x: D = None
        self.txt = txt

k = A("k")
c = B("c")
a = C("a")
i = D("i")
m = E("m")
g = F("g")
j = G("j")

k.y = j
k.x = j
k.s = c
k.o = m
k.z = m
k.r = g
k.p = a
c.w = m
c.s = i
c.q = j
c.r = a
a.o = g
i.r = a
m.p = g
m.x = c
m.q = i
m.o = j
m.s = k
g.x = m
g.s = m
g.r = k
g.u = c
j.v = k
j.z = k
j.q = c
j.x = i
assert m.q.r.o.r.p.txt == "a"