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

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: G = None
        self.x: E = None
        self.r: C = None
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: G = None
        self.x: E = None
        self.r: C = None
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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