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

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

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

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

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

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

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

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

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

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

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

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

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