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

class B:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: E = None
        self.y: B = None
        self.q: D = None
        self.x: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: E = None
        self.p: E = None
        self.txt = txt

h = A("h")
e = B("e")
n = C("n")
a = D("a")
f = E("f")
j = C("j")
d = B("d")
l = B("l")
c = E("c")
b = D("b")

h.v = c
e.p = l
e.y = l
e.s = f
e.q = b
e.x = b
n.p = j
n.t = c
n.v = c
n.r = e
n.o = h
a.s = e
a.u = b
f.o = d
f.x = c
f.p = c
j.p = n
j.t = c
j.r = d
j.o = h
j.v = f
d.p = e
d.s = c
d.y = l
d.q = b
d.x = a
l.p = e
l.s = f
l.y = d
l.q = a
l.x = b
c.o = l
c.x = f
c.p = f
b.s = l
b.u = a
assert n.p.t.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: E = None
        self.y: B = None
        self.q: D = None
        self.x: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: E = None
        self.p: E = None
        self.txt = txt

h = A("h")
e = B("e")
n = C("n")
a = D("a")
f = E("f")
j = C("j")
d = B("d")
l = B("l")
c = E("c")
b = D("b")

h.v = c
e.p = l
e.y = l
e.s = f
e.q = b
e.x = b
n.p = j
n.t = c
n.v = c
n.r = e
n.o = h
a.s = e
a.u = b
f.o = d
f.x = c
f.p = c
j.p = n
j.t = c
j.r = d
j.o = h
j.v = f
d.p = e
d.s = c
d.y = l
d.q = b
d.x = a
l.p = e
l.s = f
l.y = d
l.q = a
l.x = b
c.o = l
c.x = f
c.p = f
b.s = l
b.u = a
assert n.p.t.p.o.txt == "d"