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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: H = None
        self.y: G = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: H = None
        self.v: E = None
        self.z: H = None
        self.w: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: H = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: B = None
        self.r: D = None
        self.s: G = None
        self.y: G = None
        self.x: G = None
        self.p: D = None
        self.txt = txt

h = A("h")
g = B("g")
e = C("e")
b = D("b")
j = E("j")
i = F("i")
n = G("n")
l = H("l")

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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: H = None
        self.y: G = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: H = None
        self.v: E = None
        self.z: H = None
        self.w: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: H = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: B = None
        self.r: D = None
        self.s: G = None
        self.y: G = None
        self.x: G = None
        self.p: D = None
        self.txt = txt

h = A("h")
g = B("g")
e = C("e")
b = D("b")
j = E("j")
i = F("i")
n = G("n")
l = H("l")

h.x = j
g.s = h
g.p = j
g.x = e
e.q = n
e.y = n
e.p = l
e.z = g
b.x = i
b.q = l
b.z = l
b.v = j
b.w = j
j.v = l
j.q = l
j.y = g
i.o = j
i.w = l
i.t = e
n.x = l
n.r = l
l.o = n
l.s = n
l.y = n
l.x = n
l.w = g
l.r = b
l.p = b
assert n.r.w.p.txt == "j"