class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: E = None
        self.o: H = None
        self.v: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: E = None
        self.t: E = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: A = None
        self.v: G = None
        self.x: H = None
        self.z: F = None
        self.r: D = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: H = None
        self.q: D = None
        self.p: E = None
        self.w: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: E = None
        self.t: E = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: A = None
        self.v: G = None
        self.x: H = None
        self.z: F = None
        self.r: D = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: H = None
        self.q: D = None
        self.p: E = None
        self.w: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: A = None
        self.txt = txt

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

d.x = c
d.q = c
d.o = f
d.v = a
b.o = i
b.q = e
b.x = f
l.q = a
l.p = i
l.w = i
i.z = f
i.w = c
i.t = c
i.p = e
c.p = i
c.r = i
c.u = d
c.v = e
c.y = e
c.x = f
c.z = a
a.o = i
a.q = i
a.v = f
a.p = c
a.w = b
e.y = l
e.q = d
e.r = c
f.r = a
f.w = d
assert l.w.p.r.u.x.x.r.o.txt == "i"