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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: H = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

m.x = g
m.w = j
i.v = e
k.o = f
k.t = f
g.x = h
g.p = f
g.z = d
j.v = k
j.z = g
j.q = m
j.o = h
j.r = f
d.w = f
d.x = f
d.q = f
d.u = e
d.o = j
d.p = n
d.z = k
h.u = n
f.x = i
e.v = i
n.x = g
n.w = j
assert d.q.x.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: H = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

m.x = g
m.w = j
i.v = e
k.o = f
k.t = f
g.x = h
g.p = f
g.z = d
j.v = k
j.z = g
j.q = m
j.o = h
j.r = f
d.w = f
d.x = f
d.q = f
d.u = e
d.o = j
d.p = n
d.z = k
h.u = n
f.x = i
e.v = i
n.x = g
n.w = j
assert d.q.x.v.v.v.v.txt == "i"