class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: J = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: A = None
        self.o: B = None
        self.v: A = None
        self.p: D = None
        self.y: I = None
        self.w: F = None
        self.t: B = None
        self.r: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.w: C = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: J = None
        self.t: B = None
        self.x: A = None
        self.v: J = None
        self.w: E = None
        self.o: C = None
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: F = None
        self.v: C = None
        self.w: F = None
        self.r: C = None
        self.x: D = None
        self.y: B = None
        self.o: J = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: A = None
        self.o: B = None
        self.v: A = None
        self.p: D = None
        self.y: I = None
        self.w: F = None
        self.t: B = None
        self.r: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.w: C = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: J = None
        self.t: B = None
        self.x: A = None
        self.v: J = None
        self.w: E = None
        self.o: C = None
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: F = None
        self.v: C = None
        self.w: F = None
        self.r: C = None
        self.x: D = None
        self.y: B = None
        self.o: J = None
        self.txt = txt

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

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

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

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