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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: D = None
        self.u: E = None
        self.s: A = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: D = None
        self.u: E = None
        self.s: A = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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