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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: A = None
        self.y: A = None
        self.p: E = None
        self.q: A = None
        self.z: F = None
        self.t: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: D = None
        self.t: I = None
        self.u: D = None
        self.r: E = None
        self.y: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: J = None
        self.r: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: A = None
        self.y: A = None
        self.p: E = None
        self.q: A = None
        self.z: F = None
        self.t: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: D = None
        self.t: I = None
        self.u: D = None
        self.r: E = None
        self.y: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: J = None
        self.r: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

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