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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: F = None
        self.u: D = None
        self.txt = txt

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

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

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

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

g = A("g")
l = B("l")
n = C("n")
d = D("d")
e = E("e")
c = F("c")
a = G("a")

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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: F = None
        self.u: D = None
        self.txt = txt

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

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

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

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

g = A("g")
l = B("l")
n = C("n")
d = D("d")
e = E("e")
c = F("c")
a = G("a")

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