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

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: E = None
        self.t: D = None
        self.q: D = None
        self.r: G = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: A = None
        self.x: D = None
        self.r: D = None
        self.txt = txt

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

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

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

f = A("f")
j = B("j")
l = C("l")
n = D("n")
h = E("h")
a = F("a")
b = G("b")
d = H("d")

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

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: E = None
        self.t: D = None
        self.q: D = None
        self.r: G = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: A = None
        self.x: D = None
        self.r: D = None
        self.txt = txt

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

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

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

f = A("f")
j = B("j")
l = C("l")
n = D("n")
h = E("h")
a = F("a")
b = G("b")
d = H("d")

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