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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: A = None
        self.p: D = None
        self.txt = txt

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

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

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

a = A("a")
j = B("j")
e = C("e")
n = D("n")
h = E("h")
m = F("m")
d = E("d")
l = D("l")
c = E("c")

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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: A = None
        self.p: D = None
        self.txt = txt

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

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

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

a = A("a")
j = B("j")
e = C("e")
n = D("n")
h = E("h")
m = F("m")
d = E("d")
l = D("l")
c = E("c")

a.o = h
a.v = c
a.q = l
j.r = e
j.z = m
j.w = m
j.y = h
j.s = h
j.x = a
e.v = j
e.t = a
e.p = l
n.t = a
h.t = d
h.s = e
h.o = e
h.z = n
m.o = j
m.q = j
m.v = h
d.t = c
d.s = e
d.o = e
d.z = l
l.t = a
c.t = d
c.s = e
c.o = e
c.z = l
assert e.p.t.v.o.t.q.t.v.txt == "c"