class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

f.y = i
f.o = l
h.z = k
h.p = k
h.t = f
h.q = e
h.w = g
g.s = i
g.u = i
g.q = i
g.w = i
g.p = e
g.z = e
g.o = k
d.t = a
d.u = h
d.z = f
l.x = f
l.o = k
i.x = f
i.y = l
i.p = g
i.o = e
k.x = f
k.y = g
e.z = i
a.t = d
a.u = h
a.z = f
b.t = d
b.u = h
b.z = f
assert i.x.o.x.y.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

f.y = i
f.o = l
h.z = k
h.p = k
h.t = f
h.q = e
h.w = g
g.s = i
g.u = i
g.q = i
g.w = i
g.p = e
g.z = e
g.o = k
d.t = a
d.u = h
d.z = f
l.x = f
l.o = k
i.x = f
i.y = l
i.p = g
i.o = e
k.x = f
k.y = g
e.z = i
a.t = d
a.u = h
a.z = f
b.t = d
b.u = h
b.z = f
assert i.x.o.x.y.p.w.txt == "i"