class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: C = None
        self.r: D = None
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: G = None
        self.o: B = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: F = None
        self.y: A = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: F = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: C = None
        self.w: D = None
        self.z: G = None
        self.u: C = None
        self.o: B = None
        self.txt = txt

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

g = A("g")
f = B("f")
l = C("l")
e = D("e")
h = E("h")
i = F("i")
n = G("n")
d = G("d")

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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: G = None
        self.o: B = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: F = None
        self.y: A = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: F = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: C = None
        self.w: D = None
        self.z: G = None
        self.u: C = None
        self.o: B = None
        self.txt = txt

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

g = A("g")
f = B("f")
l = C("l")
e = D("e")
h = E("h")
i = F("i")
n = G("n")
d = G("d")

g.t = e
g.r = e
g.s = l
g.u = h
f.y = e
f.x = h
f.o = h
f.t = g
l.v = f
l.o = f
l.q = d
l.y = g
e.t = d
e.z = i
e.y = g
e.w = g
h.w = l
h.s = i
h.y = d
i.q = f
i.o = f
i.x = l
i.u = l
i.w = e
i.z = d
n.s = l
d.s = l
assert e.t.s.v.t.u.s.txt == "i"