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

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

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

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

d = A("d")
b = B("b")
a = C("a")
e = D("e")
j = C("j")
m = B("m")
h = D("h")
n = C("n")
f = C("f")

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

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

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

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

d = A("d")
b = B("b")
a = C("a")
e = D("e")
j = C("j")
m = B("m")
h = D("h")
n = C("n")
f = C("f")

d.z = j
d.s = b
b.x = h
b.o = h
b.p = m
b.v = e
a.w = d
a.y = h
a.t = b
a.s = e
e.t = h
e.x = h
e.s = a
j.w = d
j.y = e
j.s = e
j.t = b
m.x = h
m.p = b
m.v = e
m.o = e
h.t = e
h.x = e
h.s = a
n.w = d
n.y = h
n.s = h
n.t = m
f.w = d
f.y = h
f.s = h
f.t = b
assert e.x.x.s.s.s.t.v.t.x.txt == "e"