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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: D = None
        self.w: D = None
        self.q: F = None
        self.s: C = None
        self.u: C = None
        self.p: A = None
        self.v: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.v: I = None
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: B = None
        self.w: A = None
        self.o: G = None
        self.v: B = None
        self.p: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: D = None
        self.w: D = None
        self.q: F = None
        self.s: C = None
        self.u: C = None
        self.p: A = None
        self.v: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.v: I = None
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: B = None
        self.w: A = None
        self.o: G = None
        self.v: B = None
        self.p: A = None
        self.txt = txt

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

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

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