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

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

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

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

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

h = A("h")
e = B("e")
d = C("d")
j = D("j")
k = E("k")
l = B("l")
b = B("b")
a = C("a")
i = A("i")
g = B("g")

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

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

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

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

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

h = A("h")
e = B("e")
d = C("d")
j = D("j")
k = E("k")
l = B("l")
b = B("b")
a = C("a")
i = A("i")
g = B("g")

h.p = k
e.o = d
e.u = d
e.p = j
e.s = h
e.v = h
d.s = e
j.p = k
j.v = b
j.u = d
k.y = a
k.x = a
k.p = j
k.q = j
k.t = j
l.o = a
l.p = j
l.u = d
l.s = h
l.v = h
b.o = a
b.u = a
b.p = j
b.s = i
b.v = i
a.s = e
i.p = k
g.o = d
g.p = j
g.u = a
g.s = h
g.v = i
assert d.s.v.p.y.txt == "a"