class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: D = None
        self.v: D = None
        self.w: E = None
        self.z: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: D = None
        self.x: G = None
        self.z: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: D = None
        self.z: D = None
        self.u: A = None
        self.x: G = None
        self.s: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: D = None
        self.x: G = None
        self.z: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: D = None
        self.z: D = None
        self.u: A = None
        self.x: G = None
        self.s: A = None
        self.txt = txt

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

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

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