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

class B:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: B = None
        self.w: D = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: E = None
        self.t: A = None
        self.z: E = None
        self.o: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: B = None
        self.w: D = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: E = None
        self.t: A = None
        self.z: E = None
        self.o: E = None
        self.txt = txt

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

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

a.z = b
a.w = e
j.u = e
j.x = h
j.w = f
j.y = d
n.x = b
n.z = b
n.u = d
f.p = e
f.y = d
f.z = d
f.o = d
f.t = a
d.v = b
d.q = a
d.u = n
i.u = e
i.x = e
i.w = f
i.y = d
e.u = h
e.x = h
e.w = f
e.y = d
h.u = i
h.x = j
h.w = f
h.y = d
k.z = n
k.w = h
b.x = n
b.z = n
b.u = d
assert j.x.x.y.q.z.u.v.txt == "b"