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

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

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

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

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

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

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

a.v = i
e.s = a
j.p = a
j.v = h
h.y = l
h.v = j
h.u = b
h.t = b
h.p = a
b.q = l
b.t = j
b.u = e
b.p = i
b.v = a
i.p = b
i.s = e
i.q = h
l.p = b
l.s = e
l.q = h
assert j.v.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

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

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

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

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

a.v = i
e.s = a
j.p = a
j.v = h
h.y = l
h.v = j
h.u = b
h.t = b
h.p = a
b.q = l
b.t = j
b.u = e
b.p = i
b.v = a
i.p = b
i.s = e
i.q = h
l.p = b
l.s = e
l.q = h
assert j.v.p.v.txt == "i"