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

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: F = None
        self.z: G = None
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: F = None
        self.t: I = None
        self.q: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.u: I = None
        self.z: D = None
        self.r: A = None
        self.t: B = None
        self.p: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: I = None
        self.r: I = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: F = None
        self.z: G = None
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: F = None
        self.t: I = None
        self.q: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.u: I = None
        self.z: D = None
        self.r: A = None
        self.t: B = None
        self.p: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: I = None
        self.r: I = None
        self.txt = txt

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

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

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