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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: C = None
        self.z: G = None
        self.w: F = None
        self.o: G = None
        self.p: H = None
        self.x: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: G = None
        self.v: E = None
        self.w: E = None
        self.z: B = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: C = None
        self.z: G = None
        self.w: F = None
        self.o: G = None
        self.p: H = None
        self.x: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: G = None
        self.v: E = None
        self.w: E = None
        self.z: B = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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