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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: F = None
        self.w: D = None
        self.y: D = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: C = None
        self.z: C = None
        self.s: A = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: E = None
        self.s: G = None
        self.z: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

g = A("g")
e = B("e")
d = C("d")
m = D("m")
i = E("i")
l = F("l")
k = G("k")
h = F("h")
c = E("c")
n = E("n")

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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: F = None
        self.w: D = None
        self.y: D = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: C = None
        self.z: C = None
        self.s: A = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: E = None
        self.s: G = None
        self.z: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

g = A("g")
e = B("e")
d = C("d")
m = D("m")
i = E("i")
l = F("l")
k = G("k")
h = F("h")
c = E("c")
n = E("n")

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