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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: C = None
        self.s: E = None
        self.p: A = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: C = None
        self.s: E = None
        self.p: A = None
        self.y: C = None
        self.txt = txt

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

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

b.w = g
b.x = j
b.r = f
j.q = b
j.o = b
j.z = b
j.x = h
j.p = h
k.z = b
k.t = g
k.p = h
h.u = g
h.r = k
h.y = k
h.s = i
h.p = b
f.t = h
f.u = j
f.y = n
f.p = n
f.q = i
i.t = h
i.u = j
i.y = f
i.q = n
i.p = e
e.t = h
e.u = j
e.y = i
e.q = f
e.p = n
n.t = h
n.u = j
n.y = f
n.q = e
n.p = i
g.z = b
g.t = k
g.p = h
assert i.u.q.x.q.r.y.y.txt == "f"