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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: G = None
        self.t: F = None
        self.y: F = None
        self.x: H = None
        self.p: I = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.p: D = None
        self.o: A = None
        self.w: J = None
        self.v: D = None
        self.u: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: J = None
        self.o: F = None
        self.r: A = None
        self.v: G = None
        self.w: J = None
        self.t: F = None
        self.x: A = None
        self.s: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: D = None
        self.o: A = None
        self.t: J = None
        self.y: J = None
        self.q: H = None
        self.p: G = None
        self.w: I = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: G = None
        self.t: F = None
        self.y: F = None
        self.x: H = None
        self.p: I = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.p: D = None
        self.o: A = None
        self.w: J = None
        self.v: D = None
        self.u: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: J = None
        self.o: F = None
        self.r: A = None
        self.v: G = None
        self.w: J = None
        self.t: F = None
        self.x: A = None
        self.s: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: D = None
        self.o: A = None
        self.t: J = None
        self.y: J = None
        self.q: H = None
        self.p: G = None
        self.w: I = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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