class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: I = None
        self.s: B = None
        self.u: B = None
        self.q: D = None
        self.z: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: F = None
        self.x: F = None
        self.s: F = None
        self.p: C = None
        self.v: C = None
        self.w: C = None
        self.z: D = None
        self.t: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: G = None
        self.r: B = None
        self.y: E = None
        self.x: D = None
        self.p: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: G = None
        self.w: C = None
        self.o: F = None
        self.v: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: B = None
        self.x: A = None
        self.z: E = None
        self.u: I = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: F = None
        self.x: F = None
        self.s: F = None
        self.p: C = None
        self.v: C = None
        self.w: C = None
        self.z: D = None
        self.t: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: G = None
        self.r: B = None
        self.y: E = None
        self.x: D = None
        self.p: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: G = None
        self.w: C = None
        self.o: F = None
        self.v: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: B = None
        self.x: A = None
        self.z: E = None
        self.u: I = None
        self.txt = txt

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

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

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

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