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

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

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

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

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

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

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

j.w = h
j.o = h
j.v = h
j.s = e
e.s = l
e.p = a
h.x = l
h.r = a
h.v = a
h.w = a
d.v = l
d.z = h
a.y = l
l.p = j
assert a.y.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: C = None
        self.s: B = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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

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