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

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

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

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

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

a.x = e
a.t = d
a.v = g
g.o = h
i.y = h
i.v = j
i.z = a
i.u = n
d.u = c
d.t = a
d.y = g
j.y = h
j.v = e
j.z = a
j.u = n
n.x = e
n.t = h
n.v = f
f.o = d
e.y = d
e.v = i
e.z = a
e.u = a
c.o = h
h.u = g
h.t = n
h.y = f
assert a.x.y.y.o.u.o.y.o.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: D = None
        self.v: B = None
        self.txt = txt

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

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

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

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

a.x = e
a.t = d
a.v = g
g.o = h
i.y = h
i.v = j
i.z = a
i.u = n
d.u = c
d.t = a
d.y = g
j.y = h
j.v = e
j.z = a
j.u = n
n.x = e
n.t = h
n.v = f
f.o = d
e.y = d
e.v = i
e.z = a
e.u = a
c.o = h
h.u = g
h.t = n
h.y = f
assert a.x.y.y.o.u.o.y.o.t.v.txt == "g"