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

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

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

class D:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: A = None
        self.txt = txt

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

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

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