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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: C = None
        self.t: E = None
        self.q: F = None
        self.p: B = None
        self.w: C = None
        self.txt = txt

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

a = A("a")
b = B("b")
k = C("k")
i = D("i")
c = E("c")
m = F("m")
h = E("h")
n = E("n")

a.o = i
b.x = n
b.v = m
k.s = m
k.v = i
k.y = b
k.z = a
k.r = c
i.x = k
c.v = h
c.x = k
c.w = k
c.t = n
c.q = m
c.p = b
m.x = k
m.y = i
m.w = i
m.t = c
h.v = n
h.x = k
h.w = k
h.t = c
h.q = m
h.p = b
n.v = h
n.x = k
n.w = k
n.t = c
n.q = m
n.p = b
assert n.t.p.v.y.x.v.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: C = None
        self.t: E = None
        self.q: F = None
        self.p: B = None
        self.w: C = None
        self.txt = txt

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

a = A("a")
b = B("b")
k = C("k")
i = D("i")
c = E("c")
m = F("m")
h = E("h")
n = E("n")

a.o = i
b.x = n
b.v = m
k.s = m
k.v = i
k.y = b
k.z = a
k.r = c
i.x = k
c.v = h
c.x = k
c.w = k
c.t = n
c.q = m
c.p = b
m.x = k
m.y = i
m.w = i
m.t = c
h.v = n
h.x = k
h.w = k
h.t = c
h.q = m
h.p = b
n.v = h
n.x = k
n.w = k
n.t = c
n.q = m
n.p = b
assert n.t.p.v.y.x.v.x.y.txt == "b"