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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: D = None
        self.o: B = None
        self.v: D = None
        self.q: B = None
        self.txt = txt

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

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

a = A("a")
k = B("k")
i = C("i")
b = D("b")
f = E("f")
h = F("h")
e = C("e")
g = B("g")
j = D("j")
l = E("l")

a.v = f
a.p = h
k.r = h
i.p = l
i.x = f
i.v = a
i.q = a
i.z = h
b.y = h
b.x = j
b.v = j
b.o = g
b.q = k
f.p = h
f.w = h
f.r = i
f.q = a
h.v = a
h.p = a
h.q = b
e.p = f
e.x = f
e.v = a
e.q = a
e.z = h
g.r = h
j.y = h
j.x = b
j.v = b
j.o = g
j.q = g
l.p = h
l.w = h
l.r = e
l.q = a
assert b.x.q.r.v.v.r.p.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: D = None
        self.o: B = None
        self.v: D = None
        self.q: B = None
        self.txt = txt

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

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

a = A("a")
k = B("k")
i = C("i")
b = D("b")
f = E("f")
h = F("h")
e = C("e")
g = B("g")
j = D("j")
l = E("l")

a.v = f
a.p = h
k.r = h
i.p = l
i.x = f
i.v = a
i.q = a
i.z = h
b.y = h
b.x = j
b.v = j
b.o = g
b.q = k
f.p = h
f.w = h
f.r = i
f.q = a
h.v = a
h.p = a
h.q = b
e.p = f
e.x = f
e.v = a
e.q = a
e.z = h
g.r = h
j.y = h
j.x = b
j.v = b
j.o = g
j.q = g
l.p = h
l.w = h
l.r = e
l.q = a
assert b.x.q.r.v.v.r.p.p.v.txt == "a"