class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: B = None
        self.p: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: E = None
        self.u: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: B = None
        self.y: I = None
        self.x: G = None
        self.p: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: B = None
        self.y: E = None
        self.q: I = None
        self.p: E = None
        self.r: B = None
        self.o: H = None
        self.s: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: H = None
        self.r: G = None
        self.q: G = None
        self.y: F = None
        self.x: E = None
        self.v: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: E = None
        self.u: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: B = None
        self.y: I = None
        self.x: G = None
        self.p: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: B = None
        self.y: E = None
        self.q: I = None
        self.p: E = None
        self.r: B = None
        self.o: H = None
        self.s: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: H = None
        self.r: G = None
        self.q: G = None
        self.y: F = None
        self.x: E = None
        self.v: B = None
        self.txt = txt

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

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