class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: C = None
        self.s: E = None
        self.q: G = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: E = None
        self.r: H = None
        self.u: A = None
        self.q: E = None
        self.y: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: D = None
        self.x: D = None
        self.txt = txt

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

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

f = A("f")
m = B("m")
j = C("j")
n = D("n")
h = E("h")
b = F("b")
a = G("a")
i = H("i")

f.o = h
f.s = h
f.z = j
f.q = a
f.r = a
m.p = f
m.u = f
m.v = h
m.q = h
m.y = h
m.r = i
j.x = i
j.u = n
j.q = n
j.o = f
j.w = f
j.p = a
j.z = b
n.o = a
n.x = f
h.t = n
b.p = m
b.o = n
b.x = n
a.u = b
i.w = n
assert h.t.x.s.t.o.u.o.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: C = None
        self.s: E = None
        self.q: G = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: E = None
        self.r: H = None
        self.u: A = None
        self.q: E = None
        self.y: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: D = None
        self.x: D = None
        self.txt = txt

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

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

f = A("f")
m = B("m")
j = C("j")
n = D("n")
h = E("h")
b = F("b")
a = G("a")
i = H("i")

f.o = h
f.s = h
f.z = j
f.q = a
f.r = a
m.p = f
m.u = f
m.v = h
m.q = h
m.y = h
m.r = i
j.x = i
j.u = n
j.q = n
j.o = f
j.w = f
j.p = a
j.z = b
n.o = a
n.x = f
h.t = n
b.p = m
b.o = n
b.x = n
a.u = b
i.w = n
assert h.t.x.s.t.o.u.o.x.txt == "f"