class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: F = None
        self.r: C = None
        self.o: D = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: B = None
        self.x: B = None
        self.u: E = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: A = None
        self.z: E = None
        self.v: A = None
        self.txt = txt

k = A("k")
l = B("l")
j = C("j")
i = D("i")
g = E("g")
n = F("n")
m = A("m")
h = B("h")
a = E("a")

k.p = j
k.r = j
k.s = n
k.o = i
k.z = l
l.z = n
l.w = n
j.z = n
j.y = l
j.x = h
j.u = g
j.v = m
i.z = j
g.x = a
g.t = i
n.y = l
n.o = m
n.z = a
n.v = k
m.p = j
m.r = j
m.s = n
m.o = i
m.z = l
h.z = n
h.w = n
a.x = g
a.t = i
assert i.z.v.z.z.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: F = None
        self.r: C = None
        self.o: D = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: B = None
        self.x: B = None
        self.u: E = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: A = None
        self.z: E = None
        self.v: A = None
        self.txt = txt

k = A("k")
l = B("l")
j = C("j")
i = D("i")
g = E("g")
n = F("n")
m = A("m")
h = B("h")
a = E("a")

k.p = j
k.r = j
k.s = n
k.o = i
k.z = l
l.z = n
l.w = n
j.z = n
j.y = l
j.x = h
j.u = g
j.v = m
i.z = j
g.x = a
g.t = i
n.y = l
n.o = m
n.z = a
n.v = k
m.p = j
m.r = j
m.s = n
m.o = i
m.z = l
h.z = n
h.w = n
a.x = g
a.t = i
assert i.z.v.z.z.z.x.txt == "g"