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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: F = None
        self.p: E = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: B = None
        self.o: E = None
        self.s: E = None
        self.r: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: B = None
        self.x: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

f = A("f")
c = B("c")
i = C("i")
d = D("d")
k = E("k")
g = F("g")
h = G("h")
e = G("e")
j = F("j")
a = F("a")

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: F = None
        self.p: E = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: B = None
        self.o: E = None
        self.s: E = None
        self.r: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: B = None
        self.x: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

f = A("f")
c = B("c")
i = C("i")
d = D("d")
k = E("k")
g = F("g")
h = G("h")
e = G("e")
j = F("j")
a = F("a")

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