class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: G = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

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

b = A("b")
c = B("c")
e = C("e")
g = D("g")
d = E("d")
h = F("h")
l = G("l")
n = H("n")

b.q = n
b.o = l
b.s = h
c.x = d
c.s = b
c.z = b
c.t = l
c.y = n
c.u = g
c.q = h
e.p = g
g.t = d
d.w = c
d.s = b
d.o = g
h.u = l
h.o = l
h.s = c
h.q = b
h.v = g
h.t = g
l.t = e
n.x = d
n.o = h
n.p = h
n.q = g
n.t = c
assert c.y.o.v.t.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: G = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

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

b = A("b")
c = B("c")
e = C("e")
g = D("g")
d = E("d")
h = F("h")
l = G("l")
n = H("n")

b.q = n
b.o = l
b.s = h
c.x = d
c.s = b
c.z = b
c.t = l
c.y = n
c.u = g
c.q = h
e.p = g
g.t = d
d.w = c
d.s = b
d.o = g
h.u = l
h.o = l
h.s = c
h.q = b
h.v = g
h.t = g
l.t = e
n.x = d
n.o = h
n.p = h
n.q = g
n.t = c
assert c.y.o.v.t.o.t.txt == "d"