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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: C = None
        self.q: D = None
        self.r: H = None
        self.w: B = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: B = None
        self.u: H = None
        self.txt = txt

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

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

a.y = b
i.s = a
l.z = a
m.q = i
m.y = i
m.u = i
m.w = a
m.t = n
f.w = a
f.o = b
f.y = b
f.z = n
f.t = n
f.u = m
n.v = b
n.x = b
n.s = l
n.q = m
n.r = c
n.w = i
b.t = c
b.u = c
b.v = i
c.s = n
c.z = n
c.q = n
c.u = n
c.x = f
c.o = a
c.y = i
c.v = m
assert b.u.y.s.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: C = None
        self.q: D = None
        self.r: H = None
        self.w: B = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: B = None
        self.u: H = None
        self.txt = txt

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

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

a.y = b
i.s = a
l.z = a
m.q = i
m.y = i
m.u = i
m.w = a
m.t = n
f.w = a
f.o = b
f.y = b
f.z = n
f.t = n
f.u = m
n.v = b
n.x = b
n.s = l
n.q = m
n.r = c
n.w = i
b.t = c
b.u = c
b.v = i
c.s = n
c.z = n
c.q = n
c.u = n
c.x = f
c.o = a
c.y = i
c.v = m
assert b.u.y.s.y.u.txt == "c"