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

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: A = None
        self.s: D = None
        self.w: B = None
        self.r: F = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: F = None
        self.w: E = None
        self.r: F = None
        self.s: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: B = None
        self.w: D = None
        self.o: A = None
        self.r: H = None
        self.s: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: B = None
        self.r: G = None
        self.z: H = None
        self.q: F = None
        self.txt = txt

i = A("i")
m = B("m")
g = C("g")
b = D("b")
d = E("d")
f = F("f")
c = G("c")
e = H("e")
k = C("k")
a = H("a")

i.x = b
i.y = b
i.t = d
i.s = d
i.z = m
i.o = c
m.w = f
m.y = i
m.x = k
g.u = k
g.y = i
g.s = b
g.w = m
g.r = f
g.q = d
b.t = f
b.y = f
b.r = f
b.s = f
b.w = d
d.v = f
d.z = b
d.r = e
f.t = d
c.x = d
c.z = m
c.w = b
c.o = i
c.r = e
c.s = e
e.x = m
e.u = m
e.r = c
e.z = a
e.q = f
k.u = g
k.y = i
k.s = b
k.w = m
k.r = f
k.q = d
a.x = m
a.u = m
a.r = c
a.z = e
a.q = f
assert g.q.v.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: E = None
        self.z: B = None
        self.s: E = None
        self.o: G = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: A = None
        self.s: D = None
        self.w: B = None
        self.r: F = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: F = None
        self.w: E = None
        self.r: F = None
        self.s: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: B = None
        self.w: D = None
        self.o: A = None
        self.r: H = None
        self.s: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: B = None
        self.r: G = None
        self.z: H = None
        self.q: F = None
        self.txt = txt

i = A("i")
m = B("m")
g = C("g")
b = D("b")
d = E("d")
f = F("f")
c = G("c")
e = H("e")
k = C("k")
a = H("a")

i.x = b
i.y = b
i.t = d
i.s = d
i.z = m
i.o = c
m.w = f
m.y = i
m.x = k
g.u = k
g.y = i
g.s = b
g.w = m
g.r = f
g.q = d
b.t = f
b.y = f
b.r = f
b.s = f
b.w = d
d.v = f
d.z = b
d.r = e
f.t = d
c.x = d
c.z = m
c.w = b
c.o = i
c.r = e
c.s = e
e.x = m
e.u = m
e.r = c
e.z = a
e.q = f
k.u = g
k.y = i
k.s = b
k.w = m
k.r = f
k.q = d
a.x = m
a.u = m
a.r = c
a.z = e
a.q = f
assert g.q.v.t.v.txt == "f"