class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: C = None
        self.z: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: J = None
        self.p: F = None
        self.t: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.s: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: F = None
        self.w: C = None
        self.p: C = None
        self.r: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: A = None
        self.r: B = None
        self.p: F = None
        self.z: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: J = None
        self.p: F = None
        self.t: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.s: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: F = None
        self.w: C = None
        self.p: C = None
        self.r: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: A = None
        self.r: B = None
        self.p: F = None
        self.z: B = None
        self.txt = txt

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

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