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

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: A = None
        self.t: C = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: A = None
        self.t: C = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

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

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

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

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

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