class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: F = None
        self.z: F = None
        self.w: D = None
        self.r: G = None
        self.t: G = None
        self.v: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: B = None
        self.v: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: F = None
        self.o: D = None
        self.p: A = None
        self.v: F = None
        self.z: F = None
        self.t: C = None
        self.txt = txt

n = A("n")
a = B("a")
j = C("j")
d = D("d")
c = E("c")
h = F("h")
m = G("m")

n.s = m
n.r = m
n.t = m
n.p = h
n.z = h
n.w = d
n.v = j
a.x = j
j.z = h
j.r = m
j.y = a
j.q = c
d.p = a
d.o = a
d.v = c
c.p = a
c.t = j
h.o = a
h.z = a
h.y = c
h.x = d
h.v = d
h.w = d
m.r = j
m.t = j
m.x = h
m.v = h
m.z = h
m.o = d
m.p = n
assert a.x.q.t.q.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: F = None
        self.z: F = None
        self.w: D = None
        self.r: G = None
        self.t: G = None
        self.v: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: B = None
        self.v: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: F = None
        self.o: D = None
        self.p: A = None
        self.v: F = None
        self.z: F = None
        self.t: C = None
        self.txt = txt

n = A("n")
a = B("a")
j = C("j")
d = D("d")
c = E("c")
h = F("h")
m = G("m")

n.s = m
n.r = m
n.t = m
n.p = h
n.z = h
n.w = d
n.v = j
a.x = j
j.z = h
j.r = m
j.y = a
j.q = c
d.p = a
d.o = a
d.v = c
c.p = a
c.t = j
h.o = a
h.z = a
h.y = c
h.x = d
h.v = d
h.w = d
m.r = j
m.t = j
m.x = h
m.v = h
m.z = h
m.o = d
m.p = n
assert a.x.q.t.q.p.txt == "a"