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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: H = None
        self.z: A = None
        self.r: E = None
        self.t: E = None
        self.y: D = None
        self.v: D = None
        self.p: I = None
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: F = None
        self.v: H = None
        self.y: B = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: I = None
        self.w: C = None
        self.p: I = None
        self.y: H = None
        self.t: B = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: H = None
        self.q: D = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: C = None
        self.txt = txt

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

i = A("i")
m = B("m")
h = C("h")
g = D("g")
f = E("f")
c = F("c")
e = G("e")
l = H("l")
a = I("a")
j = I("j")

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: H = None
        self.z: A = None
        self.r: E = None
        self.t: E = None
        self.y: D = None
        self.v: D = None
        self.p: I = None
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: F = None
        self.v: H = None
        self.y: B = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: I = None
        self.w: C = None
        self.p: I = None
        self.y: H = None
        self.t: B = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: H = None
        self.q: D = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: C = None
        self.txt = txt

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

i = A("i")
m = B("m")
h = C("h")
g = D("g")
f = E("f")
c = F("c")
e = G("e")
l = H("l")
a = I("a")
j = I("j")

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