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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: G = None
        self.r: B = None
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: H = None
        self.y: F = None
        self.s: D = None
        self.r: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: A = None
        self.r: A = None
        self.u: B = None
        self.y: G = None
        self.p: B = None
        self.txt = txt

d = A("d")
i = B("i")
j = C("j")
a = D("a")
m = E("m")
e = F("e")
l = G("l")
n = H("n")

d.p = m
d.r = e
i.r = m
i.q = a
i.u = j
j.q = i
j.r = i
j.z = l
j.o = m
a.u = d
a.o = d
a.s = d
a.v = i
a.w = n
m.w = e
m.y = e
m.x = n
m.r = n
m.s = a
e.u = n
l.t = n
l.p = n
n.v = l
n.y = l
n.x = d
n.r = d
n.u = i
n.p = i
assert i.r.r.y.p.r.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: G = None
        self.r: B = None
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: H = None
        self.y: F = None
        self.s: D = None
        self.r: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: A = None
        self.r: A = None
        self.u: B = None
        self.y: G = None
        self.p: B = None
        self.txt = txt

d = A("d")
i = B("i")
j = C("j")
a = D("a")
m = E("m")
e = F("e")
l = G("l")
n = H("n")

d.p = m
d.r = e
i.r = m
i.q = a
i.u = j
j.q = i
j.r = i
j.z = l
j.o = m
a.u = d
a.o = d
a.s = d
a.v = i
a.w = n
m.w = e
m.y = e
m.x = n
m.r = n
m.s = a
e.u = n
l.t = n
l.p = n
n.v = l
n.y = l
n.x = d
n.r = d
n.u = i
n.p = i
assert i.r.r.y.p.r.p.s.txt == "a"