class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: D = None
        self.w: E = None
        self.o: B = None
        self.x: B = None
        self.s: B = 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.p: E = None
        self.q: I = None
        self.r: B = None
        self.t: D = None
        self.x: J = None
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: A = None
        self.r: G = None
        self.s: D = None
        self.x: G = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: E = None
        self.w: F = None
        self.u: E = None
        self.z: F = None
        self.q: C = None
        self.txt = txt

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

c.v = b
c.w = b
c.r = h
c.o = l
c.x = l
c.s = l
l.p = a
k.p = b
k.q = d
k.r = l
k.t = h
k.x = m
k.v = a
h.v = a
h.u = a
h.x = m
h.s = c
h.r = l
b.y = f
b.r = f
b.x = f
b.t = c
b.s = h
b.v = a
n.x = k
f.s = k
f.z = d
f.o = d
f.v = d
f.p = b
a.t = d
a.q = d
a.y = h
a.s = h
a.r = f
a.o = b
d.u = n
d.x = a
m.t = c
m.r = b
m.u = b
m.w = n
m.z = n
m.q = k
assert a.o.y.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: D = None
        self.w: E = None
        self.o: B = None
        self.x: B = None
        self.s: B = 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.p: E = None
        self.q: I = None
        self.r: B = None
        self.t: D = None
        self.x: J = None
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: A = None
        self.r: G = None
        self.s: D = None
        self.x: G = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: E = None
        self.w: F = None
        self.u: E = None
        self.z: F = None
        self.q: C = None
        self.txt = txt

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

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