class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: I = None
        self.t: C = None
        self.z: G = None
        self.s: C = None
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: G = None
        self.z: J = None
        self.r: B = 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: G = None
        self.w: J = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: H = None
        self.v: E = None
        self.q: A = None
        self.z: I = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: G = None
        self.z: J = None
        self.r: B = 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: G = None
        self.w: J = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: H = None
        self.v: E = None
        self.q: A = None
        self.z: I = None
        self.txt = txt

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

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

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

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

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