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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: C = None
        self.o: D = None
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: C = None
        self.p: F = None
        self.txt = txt

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

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

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

j.o = b
b.y = g
b.v = a
b.o = n
b.u = e
a.s = k
a.r = k
a.q = n
a.x = n
a.z = g
a.v = j
n.s = e
n.v = i
n.p = m
e.z = n
e.s = n
m.o = e
m.t = e
m.v = n
g.s = k
g.q = n
g.x = n
g.z = i
g.r = j
g.v = j
k.o = b
i.s = k
i.r = k
i.v = k
i.q = n
i.x = n
i.z = g
assert k.o.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: C = None
        self.o: D = None
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: C = None
        self.p: F = None
        self.txt = txt

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

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

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

j.o = b
b.y = g
b.v = a
b.o = n
b.u = e
a.s = k
a.r = k
a.q = n
a.x = n
a.z = g
a.v = j
n.s = e
n.v = i
n.p = m
e.z = n
e.s = n
m.o = e
m.t = e
m.v = n
g.s = k
g.q = n
g.x = n
g.z = i
g.r = j
g.v = j
k.o = b
i.s = k
i.r = k
i.v = k
i.q = n
i.x = n
i.z = g
assert k.o.o.v.txt == "i"