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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: G = None
        self.t: D = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: E = None
        self.q: I = None
        self.v: H = None
        self.x: I = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: F = None
        self.t: J = None
        self.w: D = None
        self.x: F = None
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: A = None
        self.r: E = None
        self.v: I = None
        self.o: A = None
        self.s: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: H = None
        self.w: E = None
        self.s: G = None
        self.y: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: A = None
        self.z: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: G = None
        self.t: D = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: E = None
        self.q: I = None
        self.v: H = None
        self.x: I = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: F = None
        self.t: J = None
        self.w: D = None
        self.x: F = None
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: A = None
        self.r: E = None
        self.v: I = None
        self.o: A = None
        self.s: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: H = None
        self.w: E = None
        self.s: G = None
        self.y: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: A = None
        self.z: D = None
        self.txt = txt

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

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