class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: C = None
        self.v: H = None
        self.o: B = None
        self.p: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: C = None
        self.z: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: F = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: C = None
        self.z: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: F = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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