class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: E = None
        self.x: G = None
        self.o: E = None
        self.s: 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: B = None
        self.v: G = None
        self.y: B = None
        self.p: G = None
        self.txt = txt

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

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

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

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

b = A("b")
d = B("d")
l = C("l")
g = D("g")
f = E("f")
c = F("c")
m = G("m")
h = E("h")
i = C("i")
a = A("a")

b.y = g
b.p = f
b.x = m
b.o = h
b.s = l
d.x = i
l.z = d
l.y = d
l.v = m
l.p = m
g.p = d
g.o = d
g.w = f
f.y = i
c.q = a
c.o = a
c.x = l
c.s = g
c.v = d
m.t = c
m.y = c
m.v = g
m.s = a
m.w = a
m.z = l
h.y = i
i.z = d
i.y = d
i.v = m
i.p = m
a.y = g
a.p = f
a.x = m
a.o = h
a.s = l
assert d.x.y.x.z.x.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: E = None
        self.x: G = None
        self.o: E = None
        self.s: 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: B = None
        self.v: G = None
        self.y: B = None
        self.p: G = None
        self.txt = txt

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

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

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

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

b = A("b")
d = B("d")
l = C("l")
g = D("g")
f = E("f")
c = F("c")
m = G("m")
h = E("h")
i = C("i")
a = A("a")

b.y = g
b.p = f
b.x = m
b.o = h
b.s = l
d.x = i
l.z = d
l.y = d
l.v = m
l.p = m
g.p = d
g.o = d
g.w = f
f.y = i
c.q = a
c.o = a
c.x = l
c.s = g
c.v = d
m.t = c
m.y = c
m.v = g
m.s = a
m.w = a
m.z = l
h.y = i
i.z = d
i.y = d
i.v = m
i.p = m
a.y = g
a.p = f
a.x = m
a.o = h
a.s = l
assert d.x.y.x.z.x.p.txt == "m"