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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: D = None
        self.u: A = None
        self.txt = txt

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

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

f.u = a
f.v = c
h.x = c
h.z = k
n.w = h
n.z = c
n.u = f
c.v = j
e.x = c
e.z = a
k.w = b
k.z = c
k.u = f
j.v = c
i.w = b
i.z = c
i.u = f
b.x = c
b.z = k
a.w = h
a.z = c
a.u = f
assert a.z.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: D = None
        self.u: A = None
        self.txt = txt

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

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

f.u = a
f.v = c
h.x = c
h.z = k
n.w = h
n.z = c
n.u = f
c.v = j
e.x = c
e.z = a
k.w = b
k.z = c
k.u = f
j.v = c
i.w = b
i.z = c
i.u = f
b.x = c
b.z = k
a.w = h
a.z = c
a.u = f
assert a.z.v.v.v.txt == "j"