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

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: H = None
        self.w: H = None
        self.q: A = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: F = None
        self.t: C = None
        self.z: G = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: H = None
        self.w: H = None
        self.q: A = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: F = None
        self.t: C = None
        self.z: G = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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