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

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

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

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: J = None
        self.x: A = None
        self.y: F = None
        self.t: B = None
        self.w: F = None
        self.r: I = None
        self.q: J = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: H = None
        self.p: E = None
        self.s: H = None
        self.o: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: J = None
        self.x: A = None
        self.y: F = None
        self.t: B = None
        self.w: F = None
        self.r: I = None
        self.q: J = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: H = None
        self.p: E = None
        self.s: H = None
        self.o: D = None
        self.txt = txt

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

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