class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: F = None
        self.o: B = None
        self.t: D = None
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: C = None
        self.z: D = None
        self.x: G = None
        self.u: A = None
        self.txt = txt

b = A("b")
h = B("h")
g = C("g")
f = D("f")
e = E("e")
c = F("c")
m = G("m")
n = H("n")
d = A("d")

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: C = None
        self.z: D = None
        self.x: G = None
        self.u: A = None
        self.txt = txt

b = A("b")
h = B("h")
g = C("g")
f = D("f")
e = E("e")
c = F("c")
m = G("m")
n = H("n")
d = A("d")

b.s = e
b.w = c
b.q = c
b.o = h
b.t = f
h.z = g
h.v = m
g.y = d
g.s = f
g.p = e
f.o = m
e.s = g
e.q = g
c.t = e
c.z = f
m.w = f
m.y = g
m.o = g
m.p = n
n.v = h
n.q = g
n.z = f
n.x = m
n.u = b
d.s = e
d.w = c
d.q = c
d.o = h
d.t = f
assert n.v.v.p.x.p.x.w.o.w.txt == "f"