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

class B:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: C = None
        self.o: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: A = None
        self.x: D = None
        self.w: B = None
        self.txt = txt

f = A("f")
j = B("j")
h = C("h")
n = D("n")
e = A("e")
k = B("k")
a = D("a")

f.v = h
f.u = h
f.q = k
f.o = k
j.p = k
j.y = h
j.o = e
h.v = f
n.s = h
n.q = e
n.x = a
n.w = k
e.v = h
e.u = h
e.q = j
e.o = k
k.p = j
k.y = h
k.o = f
a.s = h
a.q = f
a.x = n
a.w = j
assert a.s.v.o.y.v.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: C = None
        self.q: B = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: C = None
        self.o: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: A = None
        self.x: D = None
        self.w: B = None
        self.txt = txt

f = A("f")
j = B("j")
h = C("h")
n = D("n")
e = A("e")
k = B("k")
a = D("a")

f.v = h
f.u = h
f.q = k
f.o = k
j.p = k
j.y = h
j.o = e
h.v = f
n.s = h
n.q = e
n.x = a
n.w = k
e.v = h
e.u = h
e.q = j
e.o = k
k.p = j
k.y = h
k.o = f
a.s = h
a.q = f
a.x = n
a.w = j
assert a.s.v.o.y.v.o.y.txt == "h"