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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: E = None
        self.t: I = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.u: A = None
        self.p: E = None
        self.x: I = None
        self.w: D = None
        self.r: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: H = None
        self.u: G = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: E = None
        self.t: I = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.u: A = None
        self.p: E = None
        self.x: I = None
        self.w: D = None
        self.r: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: H = None
        self.u: G = None
        self.v: D = None
        self.txt = txt

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

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