class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: F = None
        self.v: B = None
        self.x: F = None
        self.p: F = None
        self.r: E = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: F = None
        self.t: E = None
        self.s: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: D = None
        self.w: A = None
        self.z: D = None
        self.txt = txt

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

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

m = A("m")
l = B("l")
n = C("n")
k = D("k")
d = E("d")
c = F("c")
j = G("j")

m.w = l
m.v = l
m.o = c
m.x = c
m.p = c
m.r = d
m.s = d
l.q = j
l.s = j
l.r = c
l.t = d
n.o = l
n.q = j
n.t = c
n.s = c
k.q = c
d.r = k
d.p = k
d.z = k
d.w = m
c.q = m
c.z = n
c.t = j
j.w = c
j.z = c
j.r = n
j.v = l
j.u = l
j.s = m
assert k.q.z.t.z.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: F = None
        self.v: B = None
        self.x: F = None
        self.p: F = None
        self.r: E = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: F = None
        self.t: E = None
        self.s: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: D = None
        self.w: A = None
        self.z: D = None
        self.txt = txt

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

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

m = A("m")
l = B("l")
n = C("n")
k = D("k")
d = E("d")
c = F("c")
j = G("j")

m.w = l
m.v = l
m.o = c
m.x = c
m.p = c
m.r = d
m.s = d
l.q = j
l.s = j
l.r = c
l.t = d
n.o = l
n.q = j
n.t = c
n.s = c
k.q = c
d.r = k
d.p = k
d.z = k
d.w = m
c.q = m
c.z = n
c.t = j
j.w = c
j.z = c
j.r = n
j.v = l
j.u = l
j.s = m
assert k.q.z.t.z.q.s.txt == "m"