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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: E = None
        self.x: G = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: F = None
        self.q: F = None
        self.y: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: G = None
        self.q: D = None
        self.s: A = None
        self.z: B = None
        self.txt = txt

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

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

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

a.x = h
a.t = j
a.u = i
m.v = i
c.o = h
c.t = j
c.x = e
c.w = e
i.p = c
i.y = c
i.x = h
i.q = h
j.x = m
j.z = c
h.t = m
h.z = m
h.u = e
h.q = i
h.s = a
e.t = c
e.s = c
e.v = j
e.o = i
f.v = e
assert c.o.s.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: E = None
        self.u: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: E = None
        self.x: G = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: F = None
        self.q: F = None
        self.y: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: G = None
        self.q: D = None
        self.s: A = None
        self.z: B = None
        self.txt = txt

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

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

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

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