class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: B = None
        self.x: H = None
        self.s: I = None
        self.p: J = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: D = None
        self.p: I = None
        self.x: C = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: J = None
        self.r: I = None
        self.w: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: A = None
        self.r: J = None
        self.x: D = None
        self.p: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: C = None
        self.x: A = None
        self.q: B = None
        self.r: A = None
        self.u: A = None
        self.z: A = None
        self.w: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: E = None
        self.q: I = None
        self.w: H = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: D = None
        self.p: I = None
        self.x: C = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: J = None
        self.r: I = None
        self.w: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: A = None
        self.r: J = None
        self.x: D = None
        self.p: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: C = None
        self.x: A = None
        self.q: B = None
        self.r: A = None
        self.u: A = None
        self.z: A = None
        self.w: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: E = None
        self.q: I = None
        self.w: H = None
        self.z: D = None
        self.txt = txt

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

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