class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: C = None
        self.x: C = None
        self.s: H = None
        self.y: E = None
        self.u: C = None
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: G = None
        self.z: H = None
        self.r: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: A = None
        self.p: H = None
        self.w: F = None
        self.u: H = None
        self.y: A = None
        self.s: C = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: C = None
        self.s: D = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: E = None
        self.t: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: G = None
        self.z: H = None
        self.r: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: A = None
        self.p: H = None
        self.w: F = None
        self.u: H = None
        self.y: A = None
        self.s: C = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: C = None
        self.s: D = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: E = None
        self.t: H = None
        self.txt = txt

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

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

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