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

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.r: F = None
        self.y: B = None
        self.x: G = None
        self.o: B = None
        self.q: H = None
        self.t: D = None
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: C = None
        self.o: H = None
        self.t: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: C = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: B = None
        self.w: F = None
        self.x: B = None
        self.t: B = None
        self.q: D = None
        self.v: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.r: F = None
        self.y: B = None
        self.x: G = None
        self.o: B = None
        self.q: H = None
        self.t: D = None
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: C = None
        self.o: H = None
        self.t: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: C = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: B = None
        self.w: F = None
        self.x: B = None
        self.t: B = None
        self.q: D = None
        self.v: A = None
        self.txt = txt

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

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