class A:
    def __init__(self, txt: str):
        self.o: J = None
        self.u: J = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: F = None
        self.r: J = None
        self.x: F = None
        self.o: I = None
        self.q: I = None
        self.z: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: I = None
        self.u: F = None
        self.y: J = None
        self.s: C = None
        self.o: F = None
        self.z: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: F = None
        self.t: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: E = None
        self.w: A = None
        self.u: H = None
        self.o: A = None
        self.y: B = None
        self.x: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: F = None
        self.r: J = None
        self.x: F = None
        self.o: I = None
        self.q: I = None
        self.z: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: I = None
        self.u: F = None
        self.y: J = None
        self.s: C = None
        self.o: F = None
        self.z: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: F = None
        self.t: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: E = None
        self.w: A = None
        self.u: H = None
        self.o: A = None
        self.y: B = None
        self.x: C = None
        self.txt = txt

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

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