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

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: C = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

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

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

m = A("m")
i = B("i")
b = C("b")
f = D("f")
k = E("k")
j = F("j")
g = G("g")
d = H("d")
c = C("c")
n = A("n")

m.y = c
i.s = b
b.z = c
b.o = c
b.s = j
f.r = i
k.v = d
j.w = k
j.q = b
g.q = i
g.r = f
g.v = d
d.u = f
d.w = m
d.t = g
c.z = b
c.o = b
c.s = j
n.y = b
assert m.y.s.w.v.w.y.o.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: C = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

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

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

m = A("m")
i = B("i")
b = C("b")
f = D("f")
k = E("k")
j = F("j")
g = G("g")
d = H("d")
c = C("c")
n = A("n")

m.y = c
i.s = b
b.z = c
b.o = c
b.s = j
f.r = i
k.v = d
j.w = k
j.q = b
g.q = i
g.r = f
g.v = d
d.u = f
d.w = m
d.t = g
c.z = b
c.o = b
c.s = j
n.y = b
assert m.y.s.w.v.w.y.o.o.s.txt == "j"