class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: H = None
        self.o: I = None
        self.x: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: C = None
        self.u: E = None
        self.y: I = None
        self.o: H = None
        self.p: H = None
        self.s: D = None
        self.v: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: C = None
        self.u: E = None
        self.y: I = None
        self.o: H = None
        self.p: H = None
        self.s: D = None
        self.v: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

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