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

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

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

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

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

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

g.y = f
e.p = m
j.u = k
j.s = f
a.o = f
a.s = f
a.z = m
a.v = k
n.y = k
n.o = i
m.o = f
m.z = i
m.s = g
m.v = n
f.y = g
k.y = n
k.o = a
i.o = f
i.z = m
i.s = g
i.v = n
assert g.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

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

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

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

g.y = f
e.p = m
j.u = k
j.s = f
a.o = f
a.s = f
a.z = m
a.v = k
n.y = k
n.o = i
m.o = f
m.z = i
m.s = g
m.v = n
f.y = g
k.y = n
k.o = a
i.o = f
i.z = m
i.s = g
i.v = n
assert g.y.y.y.y.txt == "g"