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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: G = None
        self.r: H = None
        self.x: G = None
        self.txt = txt

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

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

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

m.o = e
m.v = n
m.z = n
m.r = c
m.t = c
m.q = c
m.x = b
m.s = l
j.y = b
j.p = b
j.x = c
j.o = c
j.z = l
j.s = l
j.v = m
n.o = d
n.u = b
b.v = d
b.u = j
b.r = n
d.o = j
d.w = f
l.v = m
l.t = f
l.r = e
l.x = c
f.q = m
e.q = j
c.q = m
assert f.q.r.q.s.r.q.v.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.v: C = None
        self.r: G = None
        self.x: D = None
        self.z: C = None
        self.s: F = None
        self.t: G = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: G = None
        self.r: H = None
        self.x: G = None
        self.txt = txt

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

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

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

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