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

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

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

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

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

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

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

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

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

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

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

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

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

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

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