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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: D = None
        self.x: D = None
        self.r: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: C = None
        self.x: B = None
        self.u: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: D = None
        self.x: D = None
        self.r: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: C = None
        self.x: B = None
        self.u: B = None
        self.txt = txt

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

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