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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: D = None
        self.z: B = None
        self.w: F = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: D = None
        self.z: B = None
        self.w: F = None
        self.u: A = None
        self.txt = txt

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

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

a.p = j
a.z = j
m.p = e
m.o = n
m.y = n
m.q = a
l.x = n
l.t = n
l.p = a
l.w = a
l.o = a
l.q = a
l.r = g
g.s = j
g.z = j
g.q = j
g.r = n
g.w = e
g.t = e
j.s = d
j.q = n
h.x = b
h.q = g
h.z = m
h.w = d
h.u = a
n.u = a
n.y = a
n.p = j
n.t = m
n.v = l
e.x = n
e.t = n
e.p = a
e.w = a
e.o = a
e.q = a
e.r = g
b.x = d
b.q = g
b.z = m
b.w = h
b.u = a
d.x = b
d.q = g
d.z = m
d.w = h
d.u = a
assert b.w.u.p.txt == "j"