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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

g = A("g")
d = B("d")
h = C("h")
b = D("b")
n = E("n")
l = A("l")
i = B("i")
a = E("a")
j = A("j")

g.u = b
g.w = h
g.z = h
d.w = h
d.v = i
d.x = b
d.z = a
h.v = n
h.r = b
b.q = d
b.u = l
n.y = g
l.u = b
l.w = h
l.z = h
i.w = h
i.v = d
i.x = b
i.z = a
a.y = j
j.u = b
j.w = h
j.z = h
assert i.z.y.u.u.w.r.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: C = None
        self.z: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

g = A("g")
d = B("d")
h = C("h")
b = D("b")
n = E("n")
l = A("l")
i = B("i")
a = E("a")
j = A("j")

g.u = b
g.w = h
g.z = h
d.w = h
d.v = i
d.x = b
d.z = a
h.v = n
h.r = b
b.q = d
b.u = l
n.y = g
l.u = b
l.w = h
l.z = h
i.w = h
i.v = d
i.x = b
i.z = a
a.y = j
j.u = b
j.w = h
j.z = h
assert i.z.y.u.u.w.r.q.x.txt == "b"