class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: H = None
        self.y: C = None
        self.v: G = None
        self.w: I = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: J = None
        self.x: G = None
        self.z: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: D = None
        self.q: F = None
        self.u: A = None
        self.w: B = None
        self.s: J = None
        self.o: E = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: G = None
        self.s: C = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: J = None
        self.x: G = None
        self.z: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: D = None
        self.q: F = None
        self.u: A = None
        self.w: B = None
        self.s: J = None
        self.o: E = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: G = None
        self.s: C = None
        self.q: G = None
        self.txt = txt

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

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