class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: F = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: F = None
        self.r: C = None
        self.y: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: D = None
        self.o: E = None
        self.v: B = None
        self.txt = txt

n = A("n")
i = B("i")
d = C("d")
l = D("l")
c = E("c")
h = F("h")
m = C("m")
j = A("j")
b = A("b")
g = B("g")

n.s = d
n.y = h
n.v = i
i.p = h
i.t = h
i.r = m
i.y = m
d.y = c
d.s = c
d.o = l
d.r = g
l.o = g
l.z = m
c.p = h
h.z = l
h.q = l
h.o = c
h.v = i
m.y = c
m.s = c
m.o = l
m.r = i
j.s = m
j.y = h
j.v = i
b.s = d
b.y = h
b.v = g
g.p = h
g.t = h
g.r = m
g.y = m
assert b.y.q.o.r.y.p.o.p.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: F = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: F = None
        self.r: C = None
        self.y: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: D = None
        self.o: E = None
        self.v: B = None
        self.txt = txt

n = A("n")
i = B("i")
d = C("d")
l = D("l")
c = E("c")
h = F("h")
m = C("m")
j = A("j")
b = A("b")
g = B("g")

n.s = d
n.y = h
n.v = i
i.p = h
i.t = h
i.r = m
i.y = m
d.y = c
d.s = c
d.o = l
d.r = g
l.o = g
l.z = m
c.p = h
h.z = l
h.q = l
h.o = c
h.v = i
m.y = c
m.s = c
m.o = l
m.r = i
j.s = m
j.y = h
j.v = i
b.s = d
b.y = h
b.v = g
g.p = h
g.t = h
g.r = m
g.y = m
assert b.y.q.o.r.y.p.o.p.o.p.txt == "h"