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

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

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

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

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

g = A("g")
j = B("j")
h = C("h")
c = D("c")
i = E("i")
l = E("l")
e = C("e")
f = B("f")
m = B("m")
n = D("n")

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

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

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

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

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

g = A("g")
j = B("j")
h = C("h")
c = D("c")
i = E("i")
l = E("l")
e = C("e")
f = B("f")
m = B("m")
n = D("n")

g.v = j
g.y = j
g.t = n
g.w = l
g.z = i
j.v = g
j.t = m
j.o = l
j.u = c
j.w = h
h.z = c
h.u = g
c.p = n
i.v = h
i.u = n
l.v = h
l.u = c
e.z = c
e.u = g
f.v = g
f.t = m
f.o = l
f.u = c
f.w = h
m.v = g
m.t = f
m.o = l
m.u = n
m.w = h
n.p = c
assert f.o.u.p.p.p.p.txt == "c"