class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: J = None
        self.z: I = None
        self.r: I = None
        self.x: A = None
        self.o: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: C = None
        self.r: I = None
        self.x: E = None
        self.q: D = None
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: C = None
        self.u: I = None
        self.t: B = None
        self.o: C = None
        self.r: E = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: C = None
        self.p: J = None
        self.x: J = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: J = None
        self.z: I = None
        self.r: I = None
        self.x: A = None
        self.o: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: C = None
        self.r: I = None
        self.x: E = None
        self.q: D = None
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: C = None
        self.u: I = None
        self.t: B = None
        self.o: C = None
        self.r: E = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: C = None
        self.p: J = None
        self.x: J = None
        self.txt = txt

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

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

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

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